File: //lib/python3/dist-packages/awscli/__pycache__/testutils.cpython-38.pyc
U
>�^ˌ �
@ s d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
mZ ddlmZmZ ddlmZ zddlZW n& ek
r� Z zdZW 5 dZ[X Y nX ddlmZ ddlmZ ddlmZ dd lmZ ddlZdd
lm Z ddl!Z"ddl#m$Z$ ddl!m%Z% dd
l"m&Z& ddl'Z'ej(�rLe'j)j*e'j)_+ej,�-� Z.e�/d�Z0da1dd� Z2dd� Z3dd� Z4dd� Z5dd� Z6dd� Z7e
j8dd� �Z9dTdd�Z:dd � Z;dUd#d$�Z<G d%d&� d&e'j)�Z=G d'd(� d(e=�Z>G d)d*� d*e?�Z@G d+d,� d,e?�ZAe
j8d-d.� �ZBe
j8dVd0d1��ZCG d2d3� d3e'j)�ZDG d4d5� d5eD�ZEG d6d7� d7e'j)�ZFG d8d9� d9e?�ZGG d:d;� d;eH�ZIG d<d=� d=e?�ZJd>d?� ZKdWdBdC�ZLdDdE� ZMdFdG� ZNdHdI� ZOG dJdK� dKe'j)�ZPG dLdM� dMe�ZQG dNdO� dOe?�ZRG dPdQ� dQeH�ZSG dRdS� dSe?�ZTdS )Xa^ Test utilities for the AWS CLI.
This module includes various classes/functions that help in writing
CLI unit/integration tests. This module should not be imported by
any module **except** for test code. This is included in the CLI
package so that code that is not part of the CLI can still take
advantage of all the testing utilities we provide.
� N)�pformat)�Popen�PIPE)�StringIO)�six)�Session)�ClientError)�WaiterError)�AWSResponse)�load_plugins)� CLIDriver)�EnvironmentVariableszawscli.tests.integrationc s � fdd�}|S )z�Decorator to skip tests that should not be run on windows.
Example usage:
@skip_if_windows("Not valid")
def test_some_non_windows_stuff(self):
self.assertEqual(...)
c s t �t�� dk� �| �S )N)�Darwin�Linux)�unittestZskipIf�platform�system)�func��reason� �2/usr/lib/python3/dist-packages/awscli/testutils.py� decoratorX s
��z"skip_if_windows.<locals>.decoratorr )r r r r r �skip_if_windowsN s
r c C s: zt �| d� W n$ ttfk
r4 t �| d� Y nX dS )z4Helper function to set an invalid last modified time)���l���� h�] )r r N)�os�utime�OSError�
OverflowError)�pathr r r �set_invalid_utime^ s r c C sF t j�� } | j}|�d��tj�}|s*g }tj �
|� |�dt� | S )N� data_pathZdata_loader)�awscliZ clidriver�create_clidriver�sessionZget_config_variable�splitr �pathsep�_LOADERZsearch_paths�extendZregister_component)�driverr$ r! r r r r# j s
r# c C sb dd l } td kr^tj�tj�| j��}tj�|dd�}tj�|�sZt d�}|d krZt
d��|atS )Nr �bin�awsz�Could not find "aws" executable. Either make sure it is on your PATH, or you can explicitly set this value using "set_aws_cmd()")r"