HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/lazr/restfulclient/tests/__pycache__/test_oauth.cpython-38.pyc
U

U�Z��@s�dZeZddlZddlZddlZddlZddlmZm	Z	ddl
mZddlm
Z
mZmZmZGdd�de�ZGdd	�d	e�ZGd
d�de�Zdd
�ZdS)z"Tests for the OAuth-aware classes.�N)�	MockPatch�TempDir)�TestCase)�AccessToken�Consumer�OAuthAuthorizer�SystemWideConsumerc@seZdZdd�Zdd�ZdS)�TestConsumercCs:tddd�}|�|jd�|�|jd�|�|jd�dS)N�key�secretZapplication)r�assertEqualr
r�application_name��self�consumer�r�E/usr/lib/python3/dist-packages/lazr/restfulclient/tests/test_oauth.py�test_data_fields,szTestConsumer.test_data_fieldscCstdd�}|�|jd�dS)Nr
r)rrr
rrrr�test_default_application_name2s
z*TestConsumer.test_default_application_nameN)�__name__�
__module__�__qualname__rrrrrrr	*sr	c@s$eZdZdd�Zdd�Zdd�ZdS)�TestSystemWideConsumercCsP|�tddd��|�tddd��|�tddd��td�}|�|jd	�dS)
N�distro.nameZFooix�Zreturn_value�platform.systemZFooOS�socket.gethostnameZfoo�app namezSystem-wide: Fooix (foo)��
useFixturerrrr
rrrr�test_useful_distro_name:s�z.TestSystemWideConsumer.test_useful_distro_namecCsP|�tddd��|�tddd��|�tddd��td�}|�|jd	�dS)
Nr�rrZBarOSrZbarrzSystem-wide: BarOS (bar)rrrrr�test_empty_distro_nameDs�z-TestSystemWideConsumer.test_empty_distro_namecCsT|�tdtd�d��|�tddd��|�tddd��td	�}|�|jd
�dS)NrzOh noes!)Zside_effectrZBazOSrrZbazrzSystem-wide: BazOS (baz))rr�	Exceptionrrr
rrrr�test_broken_distro_nameNs��z.TestSystemWideConsumer.test_broken_distro_nameN)rrrr r"r$rrrrr8s

rc@seZdZdZdd�ZdS)�TestOAuthAuthorizerzTest for the OAuth Authorizer.cCs�|�t��j}tj�|d�}tddtdd�d�}|�|�|�tj�	|��|�
t�t�|�j
�tjtjB�t�|�}|�
|jjd�|�
|jjd�|�
|jjd�|�
|jjd�dS)N�credentialszconsumer.keyzconsumer.secretz
access.keyz
access.secret)Zconsumer_secret�access_token)rr�path�os�joinrrZsave_to_pathZ
assertTrue�existsr�stat�S_IMODE�st_mode�S_IREAD�S_IWRITEZload_from_pathrr
rr')rZtemp_dirZcredentials_pathr&Zloaded_credentialsrrr� test_save_to_and_load_from__path]s4�

�
���z4TestOAuthAuthorizer.test_save_to_and_load_from__pathN)rrr�__doc__r1rrrrr%Zsr%cCst���t�S)N)�unittestZ
TestLoaderZloadTestsFromNamerrrrr�
test_suitewsr4)r2�typeZ
__metaclass__r)�os.pathr,r3ZfixturesrrZ	testtoolsrZ"lazr.restfulclient.authorize.oauthrrrrr	rr%r4rrrr�<module>s"