$13 GRAYBYTE WORDPRESS FILE MANAGER $19

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/python35/lib64/python3.5/asyncio/__pycache__/

HOME
Current File : /opt/alt/python35/lib64/python3.5/asyncio/__pycache__//test_utils.cpython-35.opt-1.pyc


��Yf�8�@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddl
mZddlmZddlmZmZyddlZWnek
rdZYnXddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddl m!Z!ddl"m#Z#e	j$dkr�ddl%m&Z&nddlm&Z&dd�Z'dd�Z(ddd�Z)dd�Z*Gdd�de�Z+Gdd�de�Z,Gdd �d �Z-Gd!d"�d"e-e,�Z.d#d$d%d&�Z/e0ed'�rGd(d)�d)ej1e�Z2Gd*d+�d+e2e�Z3Gd,d-�d-e3�Z4Gd.d/�d/e-e4�Z5d0d1�Z6ej7d2d3��Z8ej7d#d$d4d5��Z9ej7d6d7d8dd#d$d9d:��Z:d;d<�Z;Gd=d>�d>ej<�Z=Gd?d@�d@ej>�Z?dAdB�Z@GdCdD�dDeA�ZBdEdF�ZCGdGdH�dHe
jD�ZDej7dIdJ��ZEejFejGejHdKdL�ZIdMdN�ZJdS)OzUtilities shared by tests.�N)�mock)�
HTTPServer)�WSGIRequestHandler�
WSGIServer�)�base_events)�compat)�events)�futures)�	selectors)�tasks)�	coroutine)�logger)�support�win32)�
socketpaircCs$tdkrdStjtj�SdS)N)�sslZ
SSLContextZPROTOCOL_SSLv23�rr�7/opt/alt/python35/lib64/python3.5/asyncio/test_utils.py�dummy_ssl_context-src
CsVtdd��}|�}|j|�}d|_z|j|�Wd|j�XdS)NcSsdS)Nrrrrr�once5szrun_briefly.<locals>.onceF)r
Zcreate_taskZ_log_destroy_pending�run_until_complete�close)�loopr�gen�trrr�run_briefly4s		r�cCsttj�|}x]|�so|dk	rP|tj�}|dkrPtj��|jtjdd|��qWdS)Nrg����MbP?r)�timer
�TimeoutErrorrrZsleep)rZpred�timeoutZdeadlinerrr�	run_untilCsr!cCs|j|j�|j�dS)z�Legacy API to run once through the event loop.

    This is the recommended pattern for test code.  It will poll the
    selector once and run all callbacks scheduled in response to I/O
    events.
    N)Z	call_soon�stopZrun_forever)rrrr�run_onceMsr#c@s(eZdZdd�Zdd�ZdS)�SilentWSGIRequestHandlercCs
tj�S)N)�io�StringIO)�selfrrr�
get_stderrZsz#SilentWSGIRequestHandler.get_stderrcGsdS)Nr)r'�format�argsrrr�log_message]sz$SilentWSGIRequestHandler.log_messageN)�__name__�
__module__�__qualname__r(r+rrrrr$Xsr$cs4eZdZdZ�fdd�Zdd�Z�S)�SilentWSGIServer�cs/t�j�\}}|j|j�||fS)N)�super�get_request�
settimeout�request_timeout)r'�request�client_addr)�	__class__rrr2eszSilentWSGIServer.get_requestcCsdS)Nr)r'r5�client_addressrrr�handle_errorjszSilentWSGIServer.handle_error)r,r-r.r4r2r9rr)r7rr/asr/c@seZdZdd�ZdS)�SSLWSGIServerMixincCs�tjjtjjt�dd�}tjj|�s]tjjtjjtj�dd�}tjj|d�}tjj|d�}tj|d|d|d	d
�}y!|j|||�|j	�Wnt
k
r�YnXdS)Nz..Ztests�testZtest_asynciozssl_key.pemzssl_cert.pem�keyfile�certfileZserver_sideT)�os�path�join�dirname�__file__�isdirrZwrap_socketZRequestHandlerClassr�OSError)r'r5r8�herer<r=Zssockrrr�finish_requestps$	
z!SSLWSGIServerMixin.finish_requestN)r,r-r.rFrrrrr:nsr:c@seZdZdS)�
SSLWSGIServerN)r,r-r.rrrrrG�srG�use_sslFc
#s�dd�}|r|n|}||t���j|��j�_tjd�fdd��}|j�z	�VWd�j��j�|j	�XdS)NcSs#d}dg}|||�dgS)Nz200 OK�Content-type�
text/plainsTest message)rIrJr)�environZstart_responseZstatusZheadersrrr�app�s	
z_run_test_server.<locals>.app�targetcs�jdd�S)NZ
poll_intervalg�������?)Z
serve_foreverr)�httpdrr�<lambda>�sz"_run_test_server.<locals>.<lambda>)
r$Zset_appZserver_address�address�	threadingZThread�startZshutdownZserver_closer@)rPrH�
server_cls�server_ssl_clsrLZserver_classZ
server_threadr)rNr�_run_test_server�s
	
	

rUZAF_UNIXc@seZdZdd�ZdS)�UnixHTTPServercCs&tjj|�d|_d|_dS)Nz	127.0.0.1�P)�socketserver�UnixStreamServer�server_bindZserver_nameZserver_port)r'rrrrZ�s	zUnixHTTPServer.server_bindN)r,r-r.rZrrrrrV�srVcs4eZdZdZdd�Z�fdd�Z�S)�UnixWSGIServerr0cCstj|�|j�dS)N)rVrZZ
setup_environ)r'rrrrZ�s
zUnixWSGIServer.server_bindcs/t�j�\}}|j|j�|dfS)N�	127.0.0.1�)r\r])r1r2r3r4)r'r5r6)r7rrr2�szUnixWSGIServer.get_request)r,r-r.r4rZr2rr)r7rr[�sr[c@seZdZdd�ZdS)�SilentUnixWSGIServercCsdS)Nr)r'r5r8rrrr9�sz!SilentUnixWSGIServer.handle_errorN)r,r-r.r9rrrrr^�sr^c@seZdZdS)�UnixSSLWSGIServerN)r,r-r.rrrrr_�sr_c	Cs!tj��}|jSWdQRXdS)N)�tempfileZNamedTemporaryFile�name)�filerrr�gen_unix_socket_path�srcccs@t�}z	|VWdytj|�Wntk
r:YnXXdS)N)rcr>�unlinkrD)r?rrr�unix_socket_path�s		
reccs;t��+}td|d|dtdt�EdHWdQRXdS)NrPrHrSrT)rerUr^r_)rHr?rrr�run_test_unix_server�srf�hostz	127.0.0.1�portc	cs.td||fd|dtdt�EdHdS)NrPrHrSrT)rUr/rG)rgrhrHrrr�run_test_server�sricCsni}xHt|�D]:}|jd�r:|jd�r:qtdd�||<qWtd|f|j|��S)N�__�return_valueZTestProtocol)�dir�
startswith�endswith�MockCallback�type�	__bases__)�baseZdctrarrr�make_test_protocol�srsc@sOeZdZdd�Zddd�Zdd�Zdd	�Zd
d�ZdS)�TestSelectorcCs
i|_dS)N)�keys)r'rrr�__init__�szTestSelector.__init__NcCs)tj|d||�}||j|<|S)Nr)rZSelectorKeyru)r'�fileobjr	�data�keyrrr�register�s
zTestSelector.registercCs|jj|�S)N)ru�pop)r'rwrrr�
unregisterszTestSelector.unregistercCsgS)Nr)r'r rrr�selectszTestSelector.selectcCs|jS)N)ru)r'rrr�get_mapszTestSelector.get_map)r,r-r.rvrzr|r}r~rrrrrt�s
rtcs!eZdZdZd�fdd�Zdd�Zdd�Z�fd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Z�fd#d$�Z�fd%d&�Zd'd(�Zd)d*�Z�S)+�TestLoopa�Loop for unittests.

    It manages self time directly.
    If something scheduled to be executed later then
    on next loop iteration after all ready handlers done
    generator passed to __init__ is calling.

    Generator should be like this:

        def gen():
            ...
            when = yield ...
            ... = yield time_advance

    Value returned by yield is absolute time of next scheduled handler.
    Value passed to yield is time advance to move loop's time forward.
    Ncs�t�j�|dkr1dd�}d|_n	d|_|�|_t|j�d|_d|_g|_t�|_	i|_
i|_|j�t
j�|_dS)Ncss	dVdS)Nrrrrrr!szTestLoop.__init__.<locals>.genFTrg��&�.>)r1rv�_check_on_close�_gen�next�_timeZ_clock_resolution�_timersrtZ	_selector�readers�writers�reset_counters�weakref�WeakValueDictionary�_transports)r'r)r7rrrvs
	
					
zTestLoop.__init__cCs|jS)N)r�)r'rrrr4sz
TestLoop.timecCs|r|j|7_dS)zMove test time forward.N)r�)r'�advancerrr�advance_time7szTestLoop.advance_timecsOt�j�|jrKy|jjd�Wntk
r>Yn
Xtd��dS)NrzTime generator is not finished)r1rr�r��send�
StopIteration�AssertionError)r')r7rrr<s
	
zTestLoop.closecGs tj|||�|j|<dS)N)r	�Handler�)r'�fd�callbackr*rrr�_add_readerFszTestLoop._add_readercCs6|j|d7<||jkr.|j|=dSdSdS)NrTF)�remove_reader_countr�)r'r�rrr�_remove_readerIs

zTestLoop._remove_readercGs|j|}dS)N)r�)r'r�r�r*�handlerrr�
assert_readerQs
zTestLoop.assert_readercGs tj|||�|j|<dS)N)r	r�r�)r'r�r�r*rrr�_add_writerYszTestLoop._add_writercCs6|j|d7<||jkr.|j|=dSdSdS)NrTF)�remove_writer_countr�)r'r�rrr�_remove_writer\s

zTestLoop._remove_writercGs|j|}dS)N)r�)r'r�r�r*r�rrr�
assert_writerds
zTestLoop.assert_writercCsBy|j|}Wntk
r%YnXtdj||���dS)Nz.File descriptor {!r} is used by transport {!r})r��KeyError�RuntimeErrorr))r'r�Z	transportrrr�_ensure_fd_no_transportls
z TestLoop._ensure_fd_no_transportcGs |j|�|j|||�S)zAdd a reader callback.)r�r�)r'r�r�r*rrr�
add_readervs
zTestLoop.add_readercCs|j|�|j|�S)zRemove a reader callback.)r�r�)r'r�rrr�
remove_reader{s
zTestLoop.remove_readercGs |j|�|j|||�S)zAdd a writer callback..)r�r�)r'r�r�r*rrr�
add_writer�s
zTestLoop.add_writercCs|j|�|j|�S)zRemove a writer callback.)r�r�)r'r�rrr�
remove_writer�s
zTestLoop.remove_writercCs(tjt�|_tjt�|_dS)N)�collections�defaultdict�intr�r�)r'rrrr��szTestLoop.reset_counterscsMt�j�x0|jD]%}|jj|�}|j|�qWg|_dS)N)r1�	_run_oncer�r�r�r�)r'�whenr�)r7rrr��s

zTestLoop._run_oncecs&|jj|�t�j|||�S)N)r��appendr1�call_at)r'r�r�r*)r7rrr��szTestLoop.call_atcCsdS)Nr)r'Z
event_listrrr�_process_events�szTestLoop._process_eventscCsdS)Nr)r'rrr�_write_to_self�szTestLoop._write_to_self)r,r-r.�__doc__rvrr�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr)r7rr
s*

rcKstjddg|�S)N�spec�__call__)rZMock)�kwargsrrrro�sroc@s"eZdZdZdd�ZdS)�MockPatternz�A regex based str with a fuzzy __eq__.

    Use this helper with 'mock.assert_called_with', or anywhere
    where a regex comparison between strings is needed.

    For instance:
       mock_call.assert_called_with(MockPattern('spam.*ham'))
    cCs"ttjt|�|tj��S)N)�bool�re�search�str�S)r'�otherrrr�__eq__�szMockPattern.__eq__N)r,r-r.r�r�rrrrr��sr�cCs2tj|�}|dkr.td|f��|S)Nzunable to get the source of %r)r	Z_get_function_source�
ValueError)�func�sourcerrr�get_function_source�sr�c@sjeZdZdddd�Zddd�Zdd	�Zd
d�Zdd
�Zej	sfdd�Z
dS)�TestCase�cleanupTcCs'tjd�|r#|j|j�dS)N)r	�set_event_loopZ
addCleanupr)r'rr�rrrr��s
zTestCase.set_event_loopNcCst|�}|j|�|S)N)rr�)r'rrrrr�
new_test_loop�s
zTestCase.new_test_loopcCs|jt_dS)N)�_get_running_loopr	)r'rrr�unpatch_get_running_loop�sz!TestCase.unpatch_get_running_loopcCs.tj|_dd�t_tj�|_dS)NcSsdS)NrrrrrrO�sz TestCase.setUp.<locals>.<lambda>)r	r�rZthreading_setup�_thread_cleanup)r'rrr�setUp�szTestCase.setUpcCsU|j�tjd�|jtj�d�|j�tj|j	�tj
�dS)N)NNN)r�r	r�ZassertEqual�sys�exc_infoZ
doCleanupsrZthreading_cleanupr�Z
reap_children)r'rrr�tearDown�s


zTestCase.tearDowncOsGdd�d�}|�S)Nc@s(eZdZdd�Zdd�ZdS)z!TestCase.subTest.<locals>.EmptyCMcSsdS)Nr)r'rrr�	__enter__�sz+TestCase.subTest.<locals>.EmptyCM.__enter__cWsdS)Nr)r'�excrrr�__exit__�sz*TestCase.subTest.<locals>.EmptyCM.__exit__N)r,r-r.r�r�rrrr�EmptyCM�sr�r)r'r*r�r�rrr�subTest�szTestCase.subTest)r,r-r.r�r�r�r�r�rZPY34r�rrrrr��s
	r�ccs;tj}ztjtjd�dVWdtj|�XdS)zrContext manager to disable asyncio logger.

    For example, it can be used to ignore warnings in debug mode.
    rN)r�levelZsetLevel�loggingZCRITICAL)Z	old_levelrrr�disable_logger�s
		r�cCs=tjtj�}||_||_||_d|j_|S)z'Create a mock of a non-blocking socket.g)rZ	MagicMock�socket�protorp�familyZ
gettimeoutrk)r�rpr�Zsockrrr�mock_nonblocking_socket�s			r�cCstjddd�S)Nz'asyncio.sslproto._is_sslproto_availablerkF)rZpatchrrrr�force_legacy_ssl_support�sr�)Kr�r��
contextlibr%r�r>r�r�rXr�r`rQrZunittestr�rZhttp.serverrZwsgiref.simple_serverrrr�ImportErrorr]rrr	r
rrZ
coroutinesr
�logrr;r�platformZ
windows_utilsrrrr!r#r$r/r:rGrU�hasattrrYrVr[r^r_rc�contextmanagerrerfrirsZBaseSelectorrtZ
BaseEventLooprror�r�r�r�r�ZIPPROTO_TCPZSOCK_STREAMZAF_INETr�r�rrrr�<module>s�

	
		
�
-


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
12 Aug 2024 8.40 AM
root / linksafe
0755
__init__.cpython-35.opt-1.pyc
0.847 KB
31 May 2024 1.51 PM
root / linksafe
0644
__init__.cpython-35.opt-2.pyc
0.782 KB
31 May 2024 1.51 PM
root / linksafe
0644
__init__.cpython-35.pyc
0.847 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_events.cpython-35.opt-1.pyc
40.409 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_events.cpython-35.opt-2.pyc
32.986 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_events.cpython-35.pyc
40.683 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_subprocess.cpython-35.opt-1.pyc
9.7 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_subprocess.cpython-35.opt-2.pyc
9.593 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_subprocess.cpython-35.pyc
9.822 KB
31 May 2024 1.51 PM
root / linksafe
0644
compat.cpython-35.opt-1.pyc
0.775 KB
31 May 2024 1.51 PM
root / linksafe
0644
compat.cpython-35.opt-2.pyc
0.649 KB
31 May 2024 1.51 PM
root / linksafe
0644
compat.cpython-35.pyc
0.775 KB
31 May 2024 1.51 PM
root / linksafe
0644
constants.cpython-35.opt-1.pyc
0.236 KB
31 May 2024 1.51 PM
root / linksafe
0644
constants.cpython-35.opt-2.pyc
0.2 KB
31 May 2024 1.51 PM
root / linksafe
0644
constants.cpython-35.pyc
0.236 KB
31 May 2024 1.51 PM
root / linksafe
0644
coroutines.cpython-35.opt-1.pyc
8.773 KB
31 May 2024 1.51 PM
root / linksafe
0644
coroutines.cpython-35.opt-2.pyc
8.539 KB
31 May 2024 1.51 PM
root / linksafe
0644
coroutines.cpython-35.pyc
8.903 KB
31 May 2024 1.51 PM
root / linksafe
0644
events.cpython-35.opt-1.pyc
25.338 KB
31 May 2024 1.51 PM
root / linksafe
0644
events.cpython-35.opt-2.pyc
18.026 KB
31 May 2024 1.51 PM
root / linksafe
0644
events.cpython-35.pyc
25.471 KB
31 May 2024 1.51 PM
root / linksafe
0644
futures.cpython-35.opt-1.pyc
15.501 KB
31 May 2024 1.51 PM
root / linksafe
0644
futures.cpython-35.opt-2.pyc
9.518 KB
31 May 2024 1.51 PM
root / linksafe
0644
futures.cpython-35.pyc
15.778 KB
31 May 2024 1.51 PM
root / linksafe
0644
locks.cpython-35.opt-1.pyc
15.71 KB
31 May 2024 1.51 PM
root / linksafe
0644
locks.cpython-35.opt-2.pyc
9.301 KB
31 May 2024 1.51 PM
root / linksafe
0644
locks.cpython-35.pyc
15.71 KB
31 May 2024 1.51 PM
root / linksafe
0644
log.cpython-35.opt-1.pyc
0.238 KB
31 May 2024 1.51 PM
root / linksafe
0644
log.cpython-35.opt-2.pyc
0.19 KB
31 May 2024 1.51 PM
root / linksafe
0644
log.cpython-35.pyc
0.238 KB
31 May 2024 1.51 PM
root / linksafe
0644
proactor_events.cpython-35.opt-1.pyc
17.376 KB
31 May 2024 1.51 PM
root / linksafe
0644
proactor_events.cpython-35.opt-2.pyc
16.966 KB
31 May 2024 1.51 PM
root / linksafe
0644
proactor_events.cpython-35.pyc
17.616 KB
31 May 2024 1.51 PM
root / linksafe
0644
protocols.cpython-35.opt-1.pyc
5.948 KB
31 May 2024 1.51 PM
root / linksafe
0644
protocols.cpython-35.opt-2.pyc
2.262 KB
31 May 2024 1.51 PM
root / linksafe
0644
protocols.cpython-35.pyc
5.948 KB
31 May 2024 1.51 PM
root / linksafe
0644
queues.cpython-35.opt-1.pyc
8.626 KB
31 May 2024 1.51 PM
root / linksafe
0644
queues.cpython-35.opt-2.pyc
5.811 KB
31 May 2024 1.51 PM
root / linksafe
0644
queues.cpython-35.pyc
8.626 KB
31 May 2024 1.51 PM
root / linksafe
0644
selector_events.cpython-35.opt-1.pyc
31.813 KB
31 May 2024 1.51 PM
root / linksafe
0644
selector_events.cpython-35.opt-2.pyc
30.248 KB
31 May 2024 1.51 PM
root / linksafe
0644
selector_events.cpython-35.pyc
31.876 KB
31 May 2024 1.51 PM
root / linksafe
0644
sslproto.cpython-35.opt-1.pyc
20.934 KB
31 May 2024 1.51 PM
root / linksafe
0644
sslproto.cpython-35.opt-2.pyc
14.252 KB
31 May 2024 1.51 PM
root / linksafe
0644
sslproto.cpython-35.pyc
21.179 KB
31 May 2024 1.51 PM
root / linksafe
0644
streams.cpython-35.opt-1.pyc
20.083 KB
31 May 2024 1.51 PM
root / linksafe
0644
streams.cpython-35.opt-2.pyc
13.933 KB
31 May 2024 1.51 PM
root / linksafe
0644
streams.cpython-35.pyc
20.407 KB
31 May 2024 1.51 PM
root / linksafe
0644
subprocess.cpython-35.opt-1.pyc
7.305 KB
31 May 2024 1.51 PM
root / linksafe
0644
subprocess.cpython-35.opt-2.pyc
7.132 KB
31 May 2024 1.51 PM
root / linksafe
0644
subprocess.cpython-35.pyc
7.34 KB
31 May 2024 1.51 PM
root / linksafe
0644
tasks.cpython-35.opt-1.pyc
20.838 KB
31 May 2024 1.51 PM
root / linksafe
0644
tasks.cpython-35.opt-2.pyc
14.081 KB
31 May 2024 1.51 PM
root / linksafe
0644
tasks.cpython-35.pyc
21.037 KB
31 May 2024 1.51 PM
root / linksafe
0644
test_utils.cpython-35.opt-1.pyc
17.32 KB
31 May 2024 1.51 PM
root / linksafe
0644
test_utils.cpython-35.opt-2.pyc
16.039 KB
31 May 2024 1.51 PM
root / linksafe
0644
test_utils.cpython-35.pyc
17.718 KB
31 May 2024 1.51 PM
root / linksafe
0644
transports.cpython-35.opt-1.pyc
12.146 KB
31 May 2024 1.51 PM
root / linksafe
0644
transports.cpython-35.opt-2.pyc
6.639 KB
31 May 2024 1.51 PM
root / linksafe
0644
transports.cpython-35.pyc
12.181 KB
31 May 2024 1.51 PM
root / linksafe
0644
unix_events.cpython-35.opt-1.pyc
31.53 KB
31 May 2024 1.51 PM
root / linksafe
0644
unix_events.cpython-35.opt-2.pyc
27.898 KB
31 May 2024 1.51 PM
root / linksafe
0644
unix_events.cpython-35.pyc
31.935 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_events.cpython-35.opt-1.pyc
22.611 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_events.cpython-35.opt-2.pyc
21.502 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_events.cpython-35.pyc
22.611 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_utils.cpython-35.opt-1.pyc
5.657 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_utils.cpython-35.opt-2.pyc
5.072 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_utils.cpython-35.pyc
5.757 KB
31 May 2024 1.51 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF