403Webshell
Server IP : 178.105.222.151  /  Your IP : 216.73.216.38
Web Server : nginx/1.28.3
System : Linux MNK 7.0.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Wed Apr 22 16:06:43 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.5.4
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/launchpadlib/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/launchpadlib/tests/__pycache__/test_http.cpython-314.pyc
+
Z4i�$��2�Rt^RIHt^RIHtHt^RIt^RIt^RIH	t	^RI
Ht^RIH
t
Ht^RIHtRt]!/4P%R	4t!R
R4t!RR
]4t!RR]
4t!RR]P.4t!RR]4t!RR]4tR#)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�*a�]tRt^8toRtRtRtVtR#)�ResponsezA fake HTTP response object.c��WnW nR#�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__�__classdictcell__��
__classdict__s@rrr8s����&��rrc�<aa�]tRt^@toRtV3RltRtRtVtV;t	#)�SimulatedResponsesHttpz<Responds to HTTP requests by shifting responses off a stack.c�L<�\SV`!V!.VnWnRVnR#)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��VPP4pVPPV4VP!W"P
.VO5!#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.rr�
__classcell__)r'rs@@rrr@s����F�	�J�Jrrc�:a�]tRt^Tto.tRt]R4tRtVt	R#)�SimulatedResponsesLaunchpadc�X�\\VP4WP.VO5!#r
)rrr%�authorization_engine)rr&s&*r�httpFactory�'SimulatedResponsesLaunchpad.httpFactoryZs+��%��$�.�.�!�4�)B�)B�
�EI�
�	
rc�N�\\P!4^,V4#)�)r�tempfile�mkstemp)�cls�credential_save_faileds&&r�credential_store_factory�4SimulatedResponsesLaunchpad.credential_store_factory_s#��-�����q�!�#9�
�	
r�N)
rrrrr%r5�classmethodr=rrrs@rr2r2Ts%�����I�
�
�
��
rr2c�0a�]tRt^ftoRtRtRtRtVtR#)�SimulatedResponsesTestCasezATest cases that give fake responses to launchpad's HTTP requests.c�>�.\n\RR4VnR#)z*Clear out the list of simulated responses.zhttp://api.example.com/�application nameN)r2r%r	�engine�rs&r�setUp� SimulatedResponsesTestCase.setUpis��02�#�-�2�%�'9�
��rc�Z�V\n\PRVPR7#)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.
rD�r4)r2r%�
login_withrE)rr%s&*r�launchpad_with_responses�3SimulatedResponsesTestCase.launchpad_with_responsesps.��1:�#�-�*�5�5��T�[�[�6�
�	
r)rEN)	rrrrrrGrLrrrs@rrBrBfs����K�
�

�

rrBc�6a�]tRt^�toRtRtRtRtRtVt	R#)�TestAbilityToParseDataaGTest 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�b�VP\^�\4\^�\44R#)z5Make sure that launchpadlib can use the minimal data.N)rLr�SIMPLE_WADL�SIMPLE_JSONrFs&r�test_minimal_data�(TestAbilityToParseData.test_minimal_data�s#���%�%��S�+�&���k�(B�	
rc	�z�VP\VP\^�R4\^�\44R#)z'Show that bad WADL causes an exception.sThis is not WADL.N)�assertRaises�SyntaxErrorrLrrRrFs&r�
test_bad_wadl�$TestAbilityToParseData.test_bad_wadl�s1�������)�)��S�.�/��S�+�&�		
rc	�z�VP\VP\^�\4\^�R44R#)z'Show that bad JSON causes an exception.sThis is not JSON.N)rVrrLrrQrFs&r�
test_bad_json�$TestAbilityToParseData.test_bad_json�s1�������)�)��S�+�&��S�.�/�		
rr?N)
rrrrrrSrXr[rrrs@rrOrO�s�����
�
�
�
rrOc�Na�]tRt^�toRtRtRtRtRtRt	Rt
RtR	tVt
R
#)�TestTokenFailureDuringRequestaTest 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�2�\^�\4\^�\4.\nVPVPP^4\PRVPR7VPVPP^4R#)z/If our token is good, we never get another one.rDrJN�	rrQrRr2r%�assertEqualrE�access_tokens_obtainedrKrFs&r�test_good_token�-TestTokenFailureDuringRequest.test_good_token�sw��
�S�+�&��S�+�&�1
�#�-�
	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc�H�\RR4\^�\4\^�\4.\nVPVPP^4\PRVPR7VPVPP^4R#)z(If our token is bad, we get another one.��Invalid token.rDrJNr`rFs&r�test_bad_token�,TestTokenFailureDuringRequest.test_bad_token�s���
�S�+�,��S�+�&��S�+�&�1
�#�-�	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc�H�\RR4\^�\4\^�\4.\nVPVPP^4\PRVPR7VPVPP^4R#)z,If our token is expired, we get another one.rf�Expired token.rDrJNr`rFs&r�test_expired_token�0TestTokenFailureDuringRequest.test_expired_token�s���
�S�+�,��S�+�&��S�+�&�1
�#�-�	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc�H�\RR4\^�\4\^�\4.\nVPVPP^4\PRVPR7VPVPP^4R#)z,If our token is unknown, we get another one.rfsUnknown access token.rDrJNr`rFs&r�test_unknown_token�0TestTokenFailureDuringRequest.test_unknown_token�s���
�S�2�3��S�+�&��S�+�&�1
�#�-�	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc�H�\^�\4\RR4\^�\4.\nVPVPP^4\PRVPR7VPVPP^4R#)z6We get another token no matter when the error happens.rfrkrDrJNr`rFs&r�test_delayed_error�0TestTokenFailureDuringRequest.test_delayed_error�s���
�S�+�&��S�+�,��S�+�&�1
�#�-�	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc�t�\RR4\^�\4\RR4\RR4\^�\4.\nVPVPP^4\PRVPR7VPVPP^4R#)z@We'll keep getting new tokens as long as tokens are the problem.rfrgrkrDrJNr`rFs&r�test_many_errors�.TestTokenFailureDuringRequest.test_many_errors�s���
�S�+�,��S�+�&��S�+�,��S�+�,��S�+�&�1
�#�-�	
������;�;�Q�?�#�.�.��T�[�[�	/�	
�	
������;�;�Q�?rc��\RR4.\nVP\\P
RVPR7R#)z>If the token is not at fault, a 401 error raises an exception.rfsSome other error.rDrJN)rr2r%rVrrKrErFs&r�test_other_unauthorized�5TestTokenFailureDuringRequest.test_other_unauthorizedsE��
�S�.�/�1
�#�-�	
����'�2�2��!%���		�	
rr?N)rrrrrrcrhrlrorrrurxrrrs@rr^r^�s8�����@�@�
@�
@�@�
@�
�
rr^)r�collectionsr�jsonrrr9�unittest�launchpadlib.errorsr�launchpadlib.credentialsr�launchpadlib.launchpadrr�launchpadlib.testing.helpersr	rQ�encoderRrrr2�TestCaserBrOr^r?rr�<module>r�s���"3��'���,�C��F���&�B�i���w�'����J�4�J�(
�)�
�$
��!2�!2�
�4 
�7� 
�Fk
�$>�k
r

Youez - 2016 - github.com/yon3zu
LinuXploit