Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/libcloud/test/common/__pycache__/test_google.cpython-39.pyc
Ðазад
a q�ht@ � @ sT d Z ddlZddlZddlZddlZddlZzddlZW n eyR ddlZY n0 ddl m Z mZmZm Z mZmZmZmZmZmZ ddlmZmZ ddlmZ zddlmZ W n ey� dZY n0 ej�ej�e��Zej� eddd �Z!ej� eddd �Z"e#e"d��"Z$e�%e$�&� �d Z'W d � n1 �s40 Y d Z(de!fZ)de"fZ*de'fZ+dZ,dZ-dZ.dZ/dZ0e� Z1dddd�Z2ddddd�Z3dddd�Z4ddee1ej5dd� �dd�Z6G dd� de7�Z8G d d!� d!e�Z9G d"d#� d#e9�Z:G d$d%� d%e9�Z;G d&d'� d'e9�Z<G d(d)� d)e9�Z=G d*d+� d+e9�Z>G d,d-� d-e�Z?e@d.k�rPe�Ae�B� � dS )/z& Tests for Google Connection classes. � N) �GoogleAuthError�GoogleAuthType�GoogleBaseAuthConnection� GoogleInstalledAppAuthConnection�GoogleServiceAcctAuthConnection�"GoogleGCEServiceAcctAuthConnection�GoogleOAuth2Credential�GoogleBaseConnection�_utcnow�_utc_timestamp)�MockHttp�LibcloudTestCase)�httplib)�SHA256ZfixturesZgooglezpkey.pemz pkey.json�rZprivate_key)�#email@developer.gserviceaccount.com�keyr )� client_id� client_secret)�foo�bar)ZGOOG0123456789ABCXYZ�(0102030405060708091011121314151617181920)ZGOOGDF5OVRRGU4APFNSTVCXIr )Z=GOOGDF5OVRRGU4APFNSTVCXIRRGU4AP56789ABCX56789ABCXRRGU4APFNSTVr � tokentoken�Bearer� ��access_token� token_type� expires_inZinstalledapp�refreshrefresh�r r r � refresh_tokenZtoken_from_file��seconds)r r �expire_timer c @ s e Zd Zdd� ZdS )�MockJsonResponsec C s || _ d S )N)�object)�self�body� r) ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/libcloud/test/common/test_google.py�__init__m s zMockJsonResponse.__init__N)�__name__� __module__�__qualname__r+ r) r) r) r* r% l s r% c sz e Zd ZdZdZejded�Zejddd�Z ejde d�Ze�d�Zejd d d�Z e� fdd��Ze� fd d��Z� ZS )�GoogleTestCasea� Assists in making Google tests hermetic and deterministic. Add anything that needs to be mocked here. Create a patcher with the suffix '_patcher'. e.g. _foo_patcher = mock.patch('module.submodule.class.foo', ...) Patchers are started at setUpClass and stopped at tearDownClass. Ideally, you should make a note in the thing being mocked, for clarity. Z_patcherzlibcloud.common.google._utcnow��return_valuez-libcloud.common.google.GoogleAuthType._is_gceFzBlibcloud.common.google.GoogleOAuth2Credential._get_token_from_filezBlibcloud.common.google.GoogleOAuth2Credential._write_token_to_filez@libcloud.common.google.GoogleInstalledAppAuthConnection.get_codei� c s<