Your IP : 216.73.216.196


Current Path : /opt/alt/python37/lib/python3.7/site-packages/betamax/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/betamax/__pycache__/decorator.cpython-37.pyc

B

�ˀXz�@s6ddlZddlZddlZddlmZdifdd�ZdS)�N�)�recordercs����fdd�}|S)amProvide a Betamax-wrapped Session for convenience.

    .. versionadded:: 0.5.0

    This decorator can be used to get a plain Session that has been wrapped in
    Betamax. For example,

    .. code-block:: python

        from betamax.decorator import use_cassette

        @use_cassette('example-decorator', cassette_library_dir='.')
        def test_get(session):
            # do things with session

    :param str cassette_name:
        Name of the cassette file in which interactions will be stored.
    :param str cassette_library_dir:
        Directory in which cassette files will be stored.
    :param dict default_cassette_options:
        Dictionary of default cassette options to set for the cassette used
        when recording these interactions.
    :param \*\*use_cassette_kwargs:
        Keyword arguments passed to :meth:`~betamax.Betamax.use_cassette`
    cs"t��������fdd��}|S)Nc	s�t��}tj|��d�}|rZ|d|dd�}}t|tj�rL||f|}q`||f|}n|f}|j�f����||�WdQRXdS)N)�session�cassette_library_dir�default_cassette_optionsrr)�requestsZSessionrZBetamax�
isinstance�unittestZTestCase�use_cassette)�args�kwargsrZrecrZfst)r�
cassette_namer�func�use_cassette_kwargs��B/opt/alt/python37/lib/python3.7/site-packages/betamax/decorator.py�test_wrapper%sz<use_cassette.<locals>.actual_decorator.<locals>.test_wrapper)�	functools�wraps)rr)rr
rr)rr�actual_decorator$sz&use_cassette.<locals>.actual_decoratorr)r
rrrrr)rr
rrrr
	sr
)rr	r�rr
rrrr�<module>s