AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/launchpadlib/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/launchpadlib/tests/__pycache__/test_credential_store.cpython-310.pyc
o

Ʋ�a�"�@s�dZddlZddlZddlZddlmZeeureZ	neZ	ddl
mZmZddl
mZmZmZmZGdd�dej�ZGdd	�d	ej�ZGd
d�de�ZGdd
�d
e�ZdS)z'Tests for the credential store classes.�N)�	b64decode)�fake_keyring�InMemoryKeyring)�AccessToken�Credentials�KeyringCredentialStore�UnencryptedFileCredentialStorec@s eZdZdZdd�Zdd�ZdS)�TestAccessTokenz Tests for the AccessToken class.cCs6t�d�}|�d|j�|�d|j�|�|j�dS)Nz;oauth_token_secret=secret%3Dpassword&oauth_token=lock%26key�lock&key�secret=password)r�from_string�assertEqual�key�secret�assertIsNone�context��self�access_token�r�J/usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py�test_from_string/s�z TestAccessToken.test_from_stringcCs8t�d�}|�d|j�|�d|j�|�d|j�dS)NzNoauth_token_secret=secret%3Dpassword&oauth_token=lock%26key&lp.context=firefoxr
r�firefox)rrr
rrrrrrr�test_from_string_with_context7s�z-TestAccessToken.test_from_string_with_contextN)�__name__�
__module__�__qualname__�__doc__rrrrrrr	,sr	c@�eZdZdd�ZdS)�CredentialStoreTestCasecCstddt|d�d�S)z(Helper method to make a fake credential.zapp namezconsumer_secret:42zaccess_secret:168)�consumer_secretr)rr)r�consumer_keyrrr�make_credentialBs
�z'CredentialStoreTestCase.make_credentialN)rrrr"rrrrrA�rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�"TestUnencryptedFileCredentialStorez3Tests for the UnencryptedFileCredentialStore class.cCst��\}|_t|j�|_dS�N)�tempfile�mkstemp�filenamer�store)r�ignorerrr�setUpNsz(TestUnencryptedFileCredentialStore.setUpcCs"tj�|j�rt�|j�dSdSr%)�os�path�existsr(�remove�rrrr�tearDownRs�z+TestUnencryptedFileCredentialStore.tearDowncCs<|�d�}|j�|d�|j�d�}|�|jj|jj�dS�N�consumer key�
unique key�r"r)�save�loadr
�consumerr�r�
credential�credential2rrr�test_save_and_loadVs
z5TestUnencryptedFileCredentialStore.test_save_and_loadcCs<|�d�}|j�|d�|j�d�}|�|jj|jj�dS)Nr3zsome keyzsome other keyr5r9rrr�test_unique_id_doesnt_matter]s
z?TestUnencryptedFileCredentialStore.test_unique_id_doesnt_mattercCsT|�d�}|�d�}|j�|d�|j�|d�|j�d�}|�|jj|jj�dS)Nr3�
consumer key2zunique key 1zunique key 2r5�r�credential1r;�loadedrrr�&test_file_only_contains_one_credentiales

zITestUnencryptedFileCredentialStore.test_file_only_contains_one_credentialN)	rrrrr+r1r<r=rBrrrrr$Ksr$c@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)�TestKeyringCredentialStorez+Tests for the KeyringCredentialStore class.cCst�|_t�|_dSr%)r�keyringrr)r0rrrr+usz TestKeyringCredentialStore.setUpcCsht|j��%|�d�}|j�|d�|j�d�}|�|jj|jj�Wd�dS1s-wYdSr2�	rrDr"r)r6r7r
r8rr9rrrr<ys
"�z-TestKeyringCredentialStore.test_save_and_loadcCs�t|j��F|�d�}|j�|d�|�d�}|j�|d�|j�d�}|�|�|�|jj	|jj	�|j�d�}|�|jj	|jj	�Wd�dS1sNwYdS)N�
consumer key1zkey 1r>zkey 2)
rrDr"r)r6r7�
assertTruer
r8r)rr@r;�loaded1�loaded2rrr�test_lookup_by_unique_key�s


"�z4TestKeyringCredentialStore.test_lookup_by_unique_keycCs�t|j��1|�d�}|j�|d�|�d�}|j�|d�|j�d�}|�|jj|jj�Wd�dS1s9wYdS)NrFzthe only keyr>rEr?rrr�/test_reused_unique_id_overwrites_old_credential�s

"�zJTestKeyringCredentialStore.test_reused_unique_id_overwrites_old_credentialcCsBt|j��|�|j�d��Wd�dS1swYdS)Nzno such key)rrDrr)r7r0rrr�test_bad_unique_id_returns_none�s"�z:TestKeyringCredentialStore.test_bad_unique_id_returns_nonecs�G�fdd�dt����|_t|j��9|�d�}|�|�|j�|d�|j�d�}|�|�|�|j	j
|j	j
�|�|j	j|j	j�Wd�dS1sOwYdS)Nc�eZdZ��fdd�Z�ZS)zWTestKeyringCredentialStore.test_keyring_returns_unicode.<locals>.UnicodeInMemoryKeyringcs*t�|��||�}t|t�r|�d�}|S)Nzutf-8)�super�get_password�
isinstance�unicode_type�encode)r�service�username�password)�UnicodeInMemoryKeyring�	__class__rrrO�s
�

zdTestKeyringCredentialStore.test_keyring_returns_unicode.<locals>.UnicodeInMemoryKeyring.get_password�rrrrO�
__classcell__r�rV�rWrrV��rVr3r4)rrDrr"rGr)r6r7r
r8rrr9rrZr�test_keyring_returns_unicode�s	


�"�z7TestKeyringCredentialStore.test_keyring_returns_unicodecs�G�fdd�dt����|_t|j��/|�d�}|j�|d�|j�d�}|�|jj	|jj	�|�|jj
|jj
�Wd�dS1sEwYdS)NcrM)zXTestKeyringCredentialStore.test_nonencoded_key_handled.<locals>.UnencodedInMemoryKeyringcs"t�|��||�}t|dd��S)N�)rNrOr)rrSrT�pw)�UnencodedInMemoryKeyringrWrrrO�s
�zeTestKeyringCredentialStore.test_nonencoded_key_handled.<locals>.UnencodedInMemoryKeyring.get_passwordrXr�r`r[rr`�r\r`r3r4)rrDrr"r)r6r7r
r8rrr9rrar�test_nonencoded_key_handled�s
�"�z6TestKeyringCredentialStore.test_nonencoded_key_handledcCsvGdd�dt�}|�|_t|j�� |�d�}|j�|d�|j�d�}|�|�Wd�dS1s4wYdS)Nc@r)zWTestKeyringCredentialStore.test_corrupted_key_handled.<locals>.CorruptedInMemoryKeyringcSsdS)N�badr)rrSrTrrrrO�szdTestKeyringCredentialStore.test_corrupted_key_handled.<locals>.CorruptedInMemoryKeyring.get_passwordN)rrrrOrrrr�CorruptedInMemoryKeyring�r#rdr3r4)rrDrr"r)r6r7r)rrdr:r;rrr�test_corrupted_key_handled�s
"�z5TestKeyringCredentialStore.test_corrupted_key_handledN)rrrrr+r<rJrKrLr]rbrerrrrrCrsrC)rr,r&�unittest�base64r�bytes�str�unicoderQ�launchpadlib.testing.helpersrr�launchpadlib.credentialsrrrr�TestCaser	rr$rCrrrr�<module>s
'

Anon7 - 2022
AnonSec Team