%PDF- %PDF-
Direktori : /lib/python3/dist-packages/launchpadlib/tests/__pycache__/ |
Current File : //lib/python3/dist-packages/launchpadlib/tests/__pycache__/test_http.cpython-312.pyc |
� '[�a�$ � �T � d Z ddlmZ ddlmZ ddlZddlZ ddlmZ ddl mZ ddlm Z ddlmZmZ dd lmZ d Z ei � j) d� Z G d� d � Z G d� de� Z G d� de� Z G d� dej2 � Z G d� de� Z G d� de� Zy# e$ r e ZY ��w xY w)z,Tests for the LaunchpadOAuthAwareHTTP class.� )�deque)�dumpsN)�JSONDecodeError)�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 � � e Zd ZdZd� Zy)�ResponsezA fake HTTP response object.c � � || _ || _ y �N)�status�content)�selfr r s �>/usr/lib/python3/dist-packages/launchpadlib/tests/test_http.py�__init__zResponse.__init__@ s � ������� N)�__name__� __module__�__qualname__�__doc__r � r r r r = s � �&�r r c �( � � e Zd ZdZ� fd�Zd� Z� xZS )�SimulatedResponsesHttpz<Responds to HTTP requests by shifting responses off a stack.c �P �� t t | � |� g | _ || _ d| _ y)z{Constructor. :param responses: A list of HttpResponse objects to use in response to requests. N)�superr r �sent_responses�unsent_responses�cache)r � responses�args� __class__s �r r zSimulatedResponsesHttp.__init__H s, �� � �$�d�4�d�;� ��� )����� r c � � | j j � }| j j |� | j ||j g|��� S r )r �popleftr �append�retry_on_bad_tokenr )r r"