%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/lazr/restfulclient/tests/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/lazr/restfulclient/tests/__pycache__/test_oauth.cpython-312.pyc

�

}�;er���dZeZddlZddlZddlZddlZddlmZm	Z	ddl
mZddlm
Z
mZmZmZGd�de�ZGd�d	e�ZGd
�de�ZGd�d
e�Zd�Zy)z"Tests for the OAuth-aware classes.�N)�	MockPatch�TempDir)�TestCase)�AccessToken�Consumer�OAuthAuthorizer�SystemWideConsumerc��eZdZd�Zd�Zy)�TestConsumerc���tddd�}|j|jd�|j|jd�|j|jd�y)N�key�secret�application)r�assertEqualr
r�application_name��self�consumers  �E/usr/lib/python3/dist-packages/lazr/restfulclient/tests/test_oauth.py�test_data_fieldszTestConsumer.test_data_fields(sN���E�8�]�;��������u�-�������(�3�����2�2�M�B�c�T�tdd�}|j|jd�y�Nr
r)rrrrs  r�test_default_application_namez*TestConsumer.test_default_application_name.s$���E�8�,������2�2�D�9rN)�__name__�
__module__�__qualname__rr�rrrr's
��C�:rrc�$�eZdZd�Zd�Zd�Zd�Zy)�TestAccessTokenc���tddd�}|j|jd�|j|jd�|j|jd�y)Nr
r�context)rrr
rr"�r�access_tokens  rrz TestAccessToken.test_data_fields5sR��"�5�(�I�>������)�)�5�1�����,�,�h�7�����-�-�y�9rc�R�tdd�}|j|j�yr)r�assertIsNoner"r#s  r�test_default_contextz$TestAccessToken.test_default_context;s"��"�5�(�3�����,�.�.�/rc�R�tdd�}|jdt|��y)N�lock&key�secret=password�;oauth_token_secret=secret%3Dpassword&oauth_token=lock%26key)rr�strr#s  r�test___str__zTestAccessToken.test___str__@s(��"�:�/@�A�����I����	
rc��tjd�}|j|jd�|j|jd�y)Nr+r)r*)r�from_stringrr
rr#s  r�test_from_stringz TestAccessToken.test_from_stringGsD��"�.�.�I�
��	
����)�)�:�6�����,�,�.?�@rN)rrrrr'r-r0rrrr r 4s��:�0�

�Arr c��eZdZd�Zd�Zd�Zy)�TestSystemWideConsumerc��|jtdd���|jtdd���|jtdd���td�}|j|jd	�y)
N�distro.name�Fooix��return_value�platform.system�FooOS�socket.gethostname�foo�app namezSystem-wide: Fooix (foo)��
useFixturerr	rr
rs  r�test_useful_distro_namez.TestSystemWideConsumer.test_useful_distro_namePs^��	
���	�-�g�F�G����	�"3�'�J�K����	�"6�U�K�L�%�j�1��������'A�Brc��|jtdd���|jtdd���|jtdd���td�}|j|jd	�y)
Nr4�r6r8�BarOSr:�barr<zSystem-wide: BarOS (bar)r=rs  r�test_empty_distro_namez-TestSystemWideConsumer.test_empty_distro_nameYs^��	
���	�-�b�A�B����	�"3�'�J�K����	�"6�U�K�L�%�j�1��������'A�Brc��|jtdtd����|jtdd���|jtdd���td	�}|j	|j
d
�y)Nr4zOh noes!)�side_effectr8�BazOSr6r:�bazr<zSystem-wide: BazOS (baz))r>r�	Exceptionr	rr
rs  r�test_broken_distro_namez.TestSystemWideConsumer.test_broken_distro_namebsh��	
����m��:�1F�G�	
�	
���	�"3�'�J�K����	�"6�U�K�L�%�j�1��������'A�BrN)rrrr?rDrJrrrr2r2Os��C�C�	Crr2c��eZdZdZd�Zy)�TestOAuthAuthorizerzTest for the OAuth Authorizer.c�T�|jt��j}tjj	|d�}tddt
dd���}|j|�|jtjj|��|jtjtj|�j�tjtjz�tj |�}|j|j"j$d�|j|j"j&d�|j|j(j$d�|j|j(j&d�y)N�credentialszconsumer.keyzconsumer.secretz
access.keyz
access.secret)�consumer_secretr$)r>r�path�os�joinrr�save_to_path�
assertTrue�existsr�stat�S_IMODE�st_mode�S_IREAD�S_IWRITE�load_from_pathrr
rr$)r�temp_dir�credentials_pathrN�loaded_credentialss     r� test_save_to_and_load_from__pathz4TestOAuthAuthorizer.test_save_to_and_load_from__pathqs;���?�?�7�9�-�2�2���7�7�<�<��-�@��%��-�$�\�?�C�
��
	� � �!1�2���������'7�8�9�	
����L�L����!1�2�:�:�;��L�L�4�=�=�(�	
�
-�;�;�<L�M�����+�4�4�8�8�.�I����+�4�4�;�;�=N�O����+�8�8�<�<�l�K�����+�+�2�2�O�	
rN)rrr�__doc__r_rrrrLrLns
��(�
rrLc�P�tj�jt�S)N)�unittest�
TestLoader�loadTestsFromNamerrrr�
test_suitere�s����� �2�2�8�<�<r)r`�type�
__metaclass__rQ�os.pathrVrb�fixturesrr�	testtoolsr�"lazr.restfulclient.authorize.oauthrrrr	rr r2rLrerrr�<module>rlsg��$)��
�
����'����
:�8�
:�A�h�A�6C�X�C�>
�(�
�@=r

Zerion Mini Shell 1.0