[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.118.151.93: ~ $


���Z-&�@sJddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
mZmZmZddl	mZyddlZWnek
r�dZYnXyddlZWnek
r�dZYnXdd�Zd	d
�Zejdd��Zejd
d��Zejdd��Zejddd��Zdd�Zdd�Zdd�Z ejdd��Z!ejdd��Zejdd��Z"ejd d!��Z#ejd"d#��Z$ejd$d%��Z%ejd&d'��Z&ejd(d)��Z'ejd*d+��Z(dS),�N)�isasyncgenfunction)�Application�)�BaseTestServer�
RawTestServer�
TestClient�
TestServer�loop_context�setup_test_loop�teardown_test_loop)�unused_portcCsa|jddddddd�|jddd	dd
dd�|jddddddd
�dS)Nz--aiohttp-fast�action�
store_true�defaultF�helpz*run tests faster by disabling extra checksz--aiohttp-loopZstore�pyloopz:run tests with specific loop: pyloop, uvloop, tokio or allz--aiohttp-enable-loop-debugzenable event loop debug mode)Z	addoption)�parser�r�/pytest_plugin.py�pytest_addoptionsrcs�|j�t��rd�ntj��r6d�ndSd�d|jkrd|jd7_d����fdd�}||_dS)zS
    Allow fixtures to be coroutines. Run coroutine fixtures in an event loop.
    TFN�requestcs�|d}�r|d=d|jkr2td��|jd���r��||����fdd�}|j|��j�j��S�j�||��SdS)Nr�loopz^Asynchronous fixtures must depend on the 'loop' fixture or be used in tests depending from it.cs0y�j�j��SWntk
r+YnXdS)N)�run_until_complete�	__anext__�StopAsyncIterationr)�_loop�genrr�	finalizerQs
z8pytest_fixture_setup.<locals>.wrapper.<locals>.finalizer)�fixturenames�	ExceptionZgetfixturevalueZaddfinalizerrr)�args�kwargsrr)�func�is_async_gen�
strip_request)rrr�wrapper<s
	
z%pytest_fixture_setup.<locals>.wrapper)r)r"r�asyncio�iscoroutinefunction�argnames)Z
fixturedefr%r)r"r#r$r�pytest_fixture_setup's			 r)cCs|jjd�S)z--fast config optionz--aiohttp-fast)�config�	getoption)rrrr�fast_sr,cCs|jjd�S)z!--enable-loop-debug config optionz--aiohttp-enable-loop-debug)r*r+)rrrr�
loop_debugesr-c
cs�tjdd��g}dVdd�|D�}|rutdjt|�t|�dkr]dnd	d
j|����WdQRXdS)z�
    Context manager which checks for RuntimeWarnings, specifically to
    avoid "coroutine 'X' was never awaited" warnings being missed.

    If RuntimeWarnings occur in the context a RuntimeError is raised.
    �recordTNcSs1g|]'}|jtkrdjd|��qS)z#{w.filename}:{w.lineno}:{w.message}�w)�category�RuntimeWarning�format)�.0r/rrr�
<listcomp>us	z,_runtime_warning_context.<locals>.<listcomp>z{} Runtime Warning{},
{}r��s�
)�warnings�catch_warnings�RuntimeErrorr2�len�join)�	_warnings�rwrrr�_runtime_warning_contextks	
		r?Fccs0|r|Vnt�}|Vt|d|�dS)z{
    setups and tears down a loop unless one is passed in via the loop
    argument when it's passed straight through.
    r,N)r
r)rr,rrr�_passthrough_loop_contexts
	r@cCs8|j|�r4tj|�r4t|j||��SdS)z/
    Fix pytest collecting for coroutines.
    N)Zfuncnamefilterr&r'�listZ
_genfunctions)Z	collector�name�objrrr�pytest_pycollect_makeitem�srDcs��jjd�}tj�j�r��jjdd�}t��Vt|d|��<}�fdd��j	j
D�}|j�j|��WdQRXWdQRXdSdS)zL
    Run coroutines in an event loop instead of a normal function call.
    z--aiohttp-fastrNr,cs i|]}�j||�qSr)�funcargs)r3�arg)�
pyfuncitemrr�
<dictcomp>�s	z&pytest_pyfunc_call.<locals>.<dictcomp>T)
r*r+r&r'�functionrE�getr?r@Z_fixtureinfor(rrC)rGr,Z
existing_looprZtestargsr)rGr�pytest_pyfunc_call�s
$rKcCs.d|jkrdS|jjj}dtji}tdk	rJtj|d<tdk	rctj|d<|dkrud}i}x~|jd�D]m}|j	d�}|j
d	�}||kr�|r�td
|t|j
��f��nq�||||<q�W|jdt|j��dt|j
���dS)N�loop_factoryr�uvloop�tokio�allzpyloop,uvloop?,tokio?�,�?z ?z&Unknown loop '%s', available loops: %sZids)rr*ZoptionZaiohttp_loopr&Znew_event_looprMrN�split�endswith�strip�
ValueErrorrA�keysZparametrize�values)ZmetafuncZloopsZavail_factoriesZ	factoriesrBZrequiredrrr�pytest_generate_tests�s0

	rXc	csEt|d|��}|r(|jd�|VWdQRXtjd�dS)z%Return an instance of the event loop.r,TN)r	Z	set_debugr&Zset_event_loop)rLr,r-rrrrr�s

rcCstjdt�|S)Nz3Deprecated, use aiohttp_unused_port fixture instead)r8�warn�DeprecationWarning)�aiohttp_unused_portrrrr�s	rcCstS)z1Return a port that is unused on the current host.)�_unused_portrrrrr[�sr[c#sLg�dd��fdd�}|V�fdd�}�j|��dS)z^Factory to create a TestServer instance, given an app.

    aiohttp_server(app, **kwargs)
    �portNc�s;t|d|�}|jd�|�IdH�j|�|S)Nr]r)r�start_server�append)Zappr]r!�server)r�serversrr�go�s
zaiohttp_server.<locals>.goc�s&x�r!�j�j�IdHqWdS)N)�pop�closer)rarr�finalize�s	z aiohttp_server.<locals>.finalize)r)rrbrer)rrar�aiohttp_server�s
rfcCstjdt�|S)Nz.Deprecated, use aiohttp_server fixture instead)r8rYrZ)rfrrr�test_server�s	rgc#sLg�dd��fdd�}|V�fdd�}�j|��dS)zpFactory to create a RawTestServer instance, given a web handler.

    aiohttp_raw_server(handler, **kwargs)
    r]Nc�s;t|d|�}|jd�|�IdH�j|�|S)Nr]r)rr^r_)�handlerr]r!r`)rrarrrbs
zaiohttp_raw_server.<locals>.goc�s&x�r!�j�j�IdHqWdS)N)rcrdr)rarrre
s	z$aiohttp_raw_server.<locals>.finalize)r)rrbrer)rrar�aiohttp_raw_server�s
ricCstjdt�|S)Nz2Deprecated, use aiohttp_raw_server fixture instead)r8rYrZ)rirrr�raw_test_servers	rjc#sLg�dd��fdd�}|V�fdd�}�j|��dS)z�Factory to create a TestClient instance.

    aiohttp_client(app, **kwargs)
    aiohttp_client(server, **kwargs)
    aiohttp_client(raw_server, **kwargs)
    �
server_kwargsNc�s�t|tj�rCt|ttf�rC|�||�}i}n|sVtd��t|t�r�|pni}t|d�|�}t|d�|�}n=t|t�r�t|d�|�}ntdt	|���|j
�IdH�j|�|S)Nzargs should be emptyrzUnknown argument type: %r)�
isinstance�collections�Callablerr�AssertionErrorrrrU�typer^r_)Z__paramrkr r!r`�client)�clientsrrrrb%s	
zaiohttp_client.<locals>.goc�s&x�r!�j�j�IdHqWdS)N)rcrdr)rrrrre=s	z aiohttp_client.<locals>.finalize)r)rrbrer)rrrr�aiohttp_clients
rscCstjdt�|S)Nz.Deprecated, use aiohttp_client fixture instead)r8rYrZ)rsrrr�test_clientDs	rt))r&rm�
contextlibr8ZpytestZaiohttp.helpersrZaiohttp.webrZ
test_utilsrrrrr	r
rrr\rM�ImportErrorrNrr)Zfixturer,r-�contextmanagerr?r@rDrKrXrr[rfrgrirjrsrtrrrr�<module>sF4

8!
)

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 947 B 0644
__init__.cpython-35.pyc File 947 B 0644
abc.cpython-35.opt-1.pyc File 6.08 KB 0644
abc.cpython-35.pyc File 6.08 KB 0644
client.cpython-35.opt-1.pyc File 22.11 KB 0644
client.cpython-35.pyc File 22.11 KB 0644
client_exceptions.cpython-35.opt-1.pyc File 8.04 KB 0644
client_exceptions.cpython-35.pyc File 8.04 KB 0644
client_proto.cpython-35.opt-1.pyc File 5.01 KB 0644
client_proto.cpython-35.pyc File 5.01 KB 0644
client_reqrep.cpython-35.opt-1.pyc File 23.56 KB 0644
client_reqrep.cpython-35.pyc File 23.69 KB 0644
client_ws.cpython-35.opt-1.pyc File 8.09 KB 0644
client_ws.cpython-35.pyc File 8.09 KB 0644
connector.cpython-35.opt-1.pyc File 24.95 KB 0644
connector.cpython-35.pyc File 24.95 KB 0644
cookiejar.cpython-35.opt-1.pyc File 8.4 KB 0644
cookiejar.cpython-35.pyc File 8.4 KB 0644
formdata.cpython-35.opt-1.pyc File 4.19 KB 0644
formdata.cpython-35.pyc File 4.19 KB 0644
frozenlist.cpython-35.opt-1.pyc File 2.73 KB 0644
frozenlist.cpython-35.pyc File 2.73 KB 0644
hdrs.cpython-35.opt-1.pyc File 3.72 KB 0644
hdrs.cpython-35.pyc File 3.72 KB 0644
helpers.cpython-35.opt-1.pyc File 24.01 KB 0644
helpers.cpython-35.pyc File 24.01 KB 0644
http.cpython-35.opt-1.pyc File 1.26 KB 0644
http.cpython-35.pyc File 1.26 KB 0644
http_exceptions.cpython-35.opt-1.pyc File 3.55 KB 0644
http_exceptions.cpython-35.pyc File 3.55 KB 0644
http_parser.cpython-35.opt-1.pyc File 14.1 KB 0644
http_parser.cpython-35.pyc File 14.16 KB 0644
http_websocket.cpython-35.opt-1.pyc File 13.92 KB 0644
http_websocket.cpython-35.pyc File 14.01 KB 0644
http_writer.cpython-35.opt-1.pyc File 4.06 KB 0644
http_writer.cpython-35.pyc File 4.06 KB 0644
locks.cpython-35.opt-1.pyc File 1.39 KB 0644
locks.cpython-35.pyc File 1.39 KB 0644
log.cpython-35.opt-1.pyc File 409 B 0644
log.cpython-35.pyc File 409 B 0644
multipart.cpython-35.opt-1.pyc File 25.14 KB 0644
multipart.cpython-35.pyc File 25.59 KB 0644
payload.cpython-35.opt-1.pyc File 9.29 KB 0644
payload.cpython-35.pyc File 9.42 KB 0644
payload_streamer.cpython-35.opt-1.pyc File 2.58 KB 0644
payload_streamer.cpython-35.pyc File 2.58 KB 0644
pytest_plugin.cpython-35.opt-1.pyc File 9.22 KB 0644
pytest_plugin.cpython-35.pyc File 9.28 KB 0644
resolver.cpython-35.opt-1.pyc File 3.33 KB 0644
resolver.cpython-35.pyc File 3.33 KB 0644
signals.cpython-35.opt-1.pyc File 1.23 KB 0644
signals.cpython-35.pyc File 1.23 KB 0644
streams.cpython-35.opt-1.pyc File 16.41 KB 0644
streams.cpython-35.pyc File 16.74 KB 0644
tcp_helpers.cpython-35.opt-1.pyc File 1.37 KB 0644
tcp_helpers.cpython-35.pyc File 1.37 KB 0644
test_utils.cpython-35.opt-1.pyc File 17.71 KB 0644
test_utils.cpython-35.pyc File 17.76 KB 0644
tracing.cpython-35.opt-1.pyc File 11.2 KB 0644
tracing.cpython-35.pyc File 11.2 KB 0644
web.cpython-35.opt-1.pyc File 4.65 KB 0644
web.cpython-35.pyc File 4.65 KB 0644
web_app.cpython-35.opt-1.pyc File 9.78 KB 0644
web_app.cpython-35.pyc File 10.24 KB 0644
web_exceptions.cpython-35.opt-1.pyc File 11.98 KB 0644
web_exceptions.cpython-35.pyc File 11.98 KB 0644
web_fileresponse.cpython-35.opt-1.pyc File 5.44 KB 0644
web_fileresponse.cpython-35.pyc File 5.44 KB 0644
web_middlewares.cpython-35.opt-1.pyc File 2.63 KB 0644
web_middlewares.cpython-35.pyc File 2.63 KB 0644
web_protocol.cpython-35.opt-1.pyc File 13.36 KB 0644
web_protocol.cpython-35.pyc File 13.39 KB 0644
web_request.cpython-35.opt-1.pyc File 19.16 KB 0644
web_request.cpython-35.pyc File 19.16 KB 0644
web_response.cpython-35.opt-1.pyc File 17.11 KB 0644
web_response.cpython-35.pyc File 17.84 KB 0644
web_runner.cpython-35.opt-1.pyc File 9.55 KB 0644
web_runner.cpython-35.pyc File 9.55 KB 0644
web_server.cpython-35.opt-1.pyc File 2.04 KB 0644
web_server.cpython-35.pyc File 2.04 KB 0644
web_urldispatcher.cpython-35.opt-1.pyc File 37.12 KB 0644
web_urldispatcher.cpython-35.pyc File 38.15 KB 0644
web_ws.cpython-35.opt-1.pyc File 12.52 KB 0644
web_ws.cpython-35.pyc File 12.52 KB 0644
worker.cpython-35.opt-1.pyc File 6.4 KB 0644
worker.cpython-35.pyc File 6.4 KB 0644