AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/launchpadlib/testing/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/launchpadlib/testing/__pycache__/helpers.cpython-310.pyc
o

�{a�@s�dZeZgd�ZddlmZddlZddlmZddl	m
Z
mZmZe
�Zdd�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�Zedd��ZGdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zedd�Zedd�Zedd�ZdS)zlaunchpadlib testing helpers.)
�BadSaveKeyring�fake_keyring�FauxSocketModule�InMemoryKeyring�NoNetworkAuthorizationEngine�NoNetworkLaunchpad�TestableLaunchpad�nopriv_read_nonprivate�salgado_read_nonprivate�salgado_with_full_permissions�)�contextmanagerN)�	Launchpad)�AccessToken�Credentials�RequestTokenAuthorizationEnginecCsttjdt�tus
Jd��dS)N�keyringz>During tests the real keyring module should never be imported.)�getattr�launchpadlib�credentials�missing�rr�>/usr/lib/python3/dist-packages/launchpadlib/testing/helpers.py�assert_keyring_not_imported2s��rcs4eZdZdZdZ�fdd�Zdd�Zdd�Z�ZS)	raAn authorization engine that doesn't open a web browser.

    You can use this to test the creation of Launchpad objects and the
    storing of credentials. You can't use it to interact with the web
    service, since it only pretends to authorize its OAuth request tokens.
    z
access_key:84cs&tt|�j|i|��d|_d|_dS)Nr)�superr�__init__�request_tokens_obtained�access_tokens_obtained)�self�args�kwargs��	__class__rrrBs
z%NoNetworkAuthorizationEngine.__init__cCs|jd7_dS)zsPretend to get a request token from the server.

        We do this by simply returning a static token ID.
        �zrequest_token:42)r)rrrrr�get_request_tokenHsz.NoNetworkAuthorizationEngine.get_request_tokencCs t|jd�|_|jd7_dS)z�Pretend to exchange a request token for an access token.

        We do this by simply setting the access_token property.
        zaccess_secret:168r"N)r�ACCESS_TOKEN_KEY�access_tokenr)rr�
request_tokenrrr�make_end_user_authorize_tokenPs�z:NoNetworkAuthorizationEngine.make_end_user_authorize_token)	�__name__�
__module__�__qualname__�__doc__r$rr#r'�
__classcell__rrr rr8src@s$eZdZdZdd�Zedd��ZdS)rz�A Launchpad instance for tests with no network access.

    It's only useful for making sure that certain methods were called.
    It can't be used to interact with the API.
    c		Cs*||_||_||_t|||||d�|_dS)N��service_root�cache�timeout�
proxy_info�version)r�authorization_engine�credential_store�dict�passed_in_args�	rrr3r4r.r/r0r1r2rrrrbs�zNoNetworkLaunchpad.__init__cGst|�S�N)r)�clsrrrr�authorization_engine_factoryxsz/NoNetworkLaunchpad.authorization_engine_factoryN)r(r)r*r+r�classmethodr:rrrrr[s
rcs2eZdZdZddddddejf�fdd�	Z�ZS)rz5A base class for talking to the testing root service.N�test_devc		
s$tt|�j||||||||d�dS)a\Provide test-friendly defaults.

        :param authorization_engine: Defaults to None, since a test
            environment can't use an authorization engine.
        :param credential_store: Defaults to None, since tests
            generally pass in fully-formed Credentials objects.
        :param service_root: Defaults to 'test_dev'.
        r-N)rrrr7r rrr�s

�zTestableLaunchpad.__init__)r(r)r*r+r
�DEFAULT_VERSIONrr,rrr rr}s�rccs@�t�|tj_ttj_zdVWtj`tj`dStj`tj`w)zAA context manager which injects a testing keyring implementation.N)rrrr�RuntimeError�NoKeyringError)�fakerrrr�s�
�rc@seZdZdZdd�ZdS)rz:A socket module replacement that provides a fake hostname.cCsdS)N�HOSTNAMEr�rrrr�gethostname��zFauxSocketModule.gethostnameN)r(r)r*r+rCrrrrr�src@s eZdZdZdd�Zdd�ZdS)rz6A keyring that generates errors when saving passwords.cCsdSr8r�r�service�usernamerrr�get_password�rDzBadSaveKeyring.get_passwordcCst�r8)r>�rrFrG�passwordrrr�set_password�rDzBadSaveKeyring.set_passwordN)r(r)r*r+rHrKrrrrr�src@s(eZdZdZdd�Zdd�Zdd�ZdS)	rz.A keyring that saves passwords only in memory.cCs
i|_dSr8��datarBrrrr�s
zInMemoryKeyring.__init__cCs||j||f<dSr8rLrIrrrrK�szInMemoryKeyring.set_passwordcCs|j�||f�Sr8)rM�getrErrrrH�szInMemoryKeyring.get_passwordN)r(r)r*r+rrKrHrrrrr�s
rc@s,eZdZdZdd�Zdddejfdd�ZdS)�KnownTokensz'Known access token/secret combinations.cCs,||_||_t||�|_td|jd�|_dS)Nzlaunchpad-library)�
consumer_namer%)�token_string�
access_secretr�tokenrr)rrQrRrrrr�s�zKnownTokens.__init__NcCst|j||||d�S)z2Create a Launchpad object using these credentials.)r/r0r1r2)rr)rr/r0r1r2rrr�login�s�zKnownTokens.login)r(r)r*r+rr
r=rTrrrrrO�s
�rOzsalgado-change-anything�testzsalgado-read-nonprivate�secretznopriv-read-nonprivate�mystery)r+�type�
__metaclass__�__all__�
contextlibrr�launchpadlib.launchpadr
�launchpadlib.credentialsrrr�objectrrrrrrrrrrOr
r	rrrrr�<module>s*
#""






Anon7 - 2022
AnonSec Team