python (3.11.7)

(root)/
lib/
python3.11/
unittest/
__pycache__/
case.cpython-311.pyc

eBdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZmZmZmZmZdZeZdZGdd	eZGd
deZGdd
eZGddeZdZdZdZdZgZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(GddZ)Gdde)Z*Gd d!e*Z+Gd"d#e*Z,Gd$d%ej-Z.Gd&d'eZ/Gd(d)e/Z0Gd*d+e/Z1dS),zTest case implementationN)result)strclass	safe_repr_count_diff_all_purpose_count_diff_hashable_common_shorten_reprTz@
Diff is %s characters long. Set self.maxDiff to None to see it.ceZdZdZdS)SkipTestz
    Raise this exception in a test to skip it.

    Usually you can use TestCase.skipTest() or one of the skipping decorators
    instead of raising this directly.
    N__name__
__module____qualname____doc__A/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/unittest/case.pyrrsrrceZdZdZdS)_ShouldStopz
    The test should stop.
    Nrrrrrr!rrceZdZdZdS)_UnexpectedSuccessz7
    The test was supposed to fail, but it didn't!
    Nrrrrrr&rrrc8eZdZddZejddZdS)_OutcomeNchd|_||_t|d|_d|_d|_dS)NF
addSubTestT)expecting_failurerhasattrresult_supports_subtestssuccessexpectedFailure)selfrs  r__init__z_Outcome.__init__-s8!&(/(E(E%#rFc#BK|j}d|_	dV|r(|jr!|j|j|dn#t$rt
$r4}d|_t
|j|t|Yd}~nzd}~wt$rYnktj
}|jr||_nAd|_|r"|j|j||nt|j||d}YnxYw|jo||_dS#|jo||_wxYw)NTF)r rr	test_caseKeyboardInterruptr_addSkipstrrsysexc_inforr!	_addError)r"r%subTestold_successer*s      rtestPartExecutorz_Outcome.testPartExecutor4sql	8EEE,
M4<
M&&y':ItLLL-!				5	5	5 DLT[)SVV44444444			D	|~~H%
@'/$$$@K**9+>	8TTTTdk9h???HHH
 <7KDLLL4<7KDL7777s;A+DC;*B?D
C;DA&C;9DDN)F)r
rrr#
contextlibcontextmanagerr/rrrrr,sL$$$$888888rrct|dd}||||dStjdtd|j|dS)NaddSkipz4TestResult has no addSkip method, skips not reported)getattrwarningswarnRuntimeWarning
addSuccess)rr%reasonr4s    rr'r'Usffi..G	6"""""
L$a	)	)	))$$$$$rc|C|Ct|d|jr|j||dS|j||dSdSdS)Nr)
issubclassfailureException
addFailureaddError)rtestr*s   rr+r+^si
h2hqk4#899	,FdH-----FOD(+++++	22rc|Sr0r)objs r_idrDesJrct|}	|j}|j}n/#t$r"t	d|jd|jddwxYw||}|||ddd|S)N'.z6' object does not support the context manager protocol)type	__enter____exit__AttributeError	TypeErrorrr)cm
addcleanupclsenterexitrs      r_enter_contextrRisr((CO
|OOODCNDDS-=DDDEEJN	OOU2YYFJtRtT***Ms	 ,Ac@t|||fdS)znSame as addCleanup, except the cleanup items are called even if
    setUpModule fails (unlike tearDownModule).N)_module_cleanupsappend)functionargskwargss   raddModuleCleanuprYys%XtV455555rc,t|tS)z&Same as enterContext, but module-wide.)rRrY)rMs renterModuleContextr[~s".///rcg}trZt\}}}	||i|n,#t$r}||Yd}~nd}~wwxYwtZ|r|ddS)zWExecute all module cleanup functions. Normally called for you after
    tearDownModule.Nr)rTpop	ExceptionrU)
exceptionsrVrWrXexcs     rdoModuleCleanupsrasJ
#!1!5!5!7!7$	#Hd%f%%%%	#	#	#c""""""""	#	#ms1
AAAcdfd}ttjr}d||S|S)z&
    Unconditionally skip a test.
    ct|ts!tj|fd}|}d|_|_|S)Nc"tr0r)rWrXr;s  rskip_wrapperz-skip.<locals>.decorator.<locals>.skip_wrappersv&&&rT)
isinstancerH	functoolswraps__unittest_skip____unittest_skip_why__)	test_itemrfr;s  r	decoratorzskip.<locals>.decorators^)T**	%
_Y
'
'
'
'
'
'(
'
'$I&*	#*0	'r)rgtypesFunctionType)r;rmrls`  rskiprqsS					&%,--$	y###rc2|rt|StS)z/
    Skip a test if the condition is true.
    rqrD	conditionr;s  rskipIfrvsF||Jrc2|st|StS)z3
    Skip a test unless the condition is true.
    rsrts  r
skipUnlessrxsF||Jrcd|_|S)NT)__unittest_expecting_failure__)rls rr!r!s/3I,rct|trtfd|DSt|tot	|S)Nc38K|]}t|VdSr0)_is_subtype).0r.basetypes  r	<genexpr>z_is_subtype.<locals>.<genexpr>s->>;q(++>>>>>>r)rgtupleallrHr=)expectedrs `rr}r}sW(E""?>>>>X>>>>>>h%%H*Xx*H*HHrceZdZdZdZdS)_BaseTestCaseContextc||_dSr0)r%)r"r%s  rr#z_BaseTestCaseContext.__init__s
"rcv|j|j|}|j|r0)r%_formatMessagemsgr>)r"standardMsgrs   r
_raiseFailurez"_BaseTestCaseContext._raiseFailures1n++DHkBBn--c222rN)r
rrr#rrrrrrs2###33333rrceZdZddZdZdS)_AssertRaisesBaseContextNct||||_||_|t	j|}||_d|_d|_dSr0)	rr#rr%recompileexpected_regexobj_namer)r"rr%rs    rr#z!_AssertRaisesBaseContext.__init__sU%%dI666 
"%Z77N,
rc	t|j|jst|d|j|sM|dd|_|r,ttt|d|d}S|^}}	|j	|_
n$#t$rt||_
YnwxYw|5||i|dddn#1swxYwYd}dS#d}wxYw)z
        If args is empty, assertRaises/Warns is being used as a
        context manager, so check for a 'msg' kwarg and return self.
        If args is not empty, call a callable passing positional and keyword
        arguments.
        z() arg 1 must be rNz1 is an invalid keyword argument for this function)
r}r
_base_typerL_base_type_strr]rnextiterr
rrKr()r"namerWrXcallable_objs     rhandlez_AssertRaisesBaseContext.handlesz	t}do>>
=!%t':':!<===
!::eT22M#7;DLL7I7I7I7I%LMMMDD#'L4
2 , 5

!
2
2
2 #L 1 1



2
.
.d-f---
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.DDD4DKKKKsZA?C C 	BC B74C 6B77C <	CC CC CC  C$r0)r
rrr#rrrrrrs7rrcFeZdZdZeZdZdZdZe	e
jZdS)_AssertRaisesContextzCA context manager used to implement TestCase.assertRaises* methods.z-an exception type or tuple of exception typesc|Sr0rr"s rrIz_AssertRaisesContext.__enter__src|	|jj}n$#t$rt|j}YnwxYw|jr/|d||jn=|d|ntj|t||jsdS|
d|_|jdS|j}|
t|s;|d|jt|dS)Nz{} not raised by {}z
{} not raisedFT"{}" does not match "{}")rr
rKr(rrformat	tracebackclear_framesr=with_traceback	exceptionrsearchpattern)r"exc_type	exc_valuetbexc_namers      rrJz_AssertRaisesContext.__exit__se
.=1!
.
.
.t}--
.}
E""#8#?#?@D
$O$OPPPP""?#9#9(#C#CDDDD"2&&&(DM22	5"11$77&4,$$S^^44	>9@@#+S^^ = =
>
>
>ts22N)
r
rrr
BaseExceptionrrrIrJclassmethodroGenericAlias__class_getitem__rrrrrsSMMJDN6$E$677rrc&eZdZdZeZdZdZdZdS)_AssertWarnsContextzBA context manager used to implement TestCase.assertWarns* methods.z(a warning type or tuple of warning typesc6ttjD]}t	|ddri|_t
jd|_|j	|_t
j
d|j|S)N__warningregistry__T)recordalways)listr)modulesvaluesr6rr7catch_warningswarnings_managerrIsimplefilterr)r"vs  rrIz_AssertWarnsContext.__enter__ sck((**++	+	+Aq/66
+(*% ( 7t D D D-7799
h
666rc|j||||dS	|jj}n$#t$rt|j}YnwxYwd}|jD]s}|j}t||js||}|j	(|j	
t|sR||_|j|_|j
|_
dS|@|d|j	jt||jr0|d||jdS|d|dS)Nrz{} not triggered by {}z{} not triggered)rrJrr
rKr(r7messagergrrwarningfilenamelinenorrrr)r"rrrrfirst_matchingmws        rrJz_AssertWarnsContext.__exit__+s&&xB???F	*}-HH	*	*	*4=))HHH	*
	
	A	Aa//
%!"#/'..s1vv660DLJDM(DKFF%9@@(0#n2E2E G G
H
H
H=	D7>>x?C} N N
O
O
O
O
O
188BBCCCCCs/AAN)	r
rrrWarningrrrIrJrrrrrsGLLJ?N			 D D D D DrrceZdZdZdS)_OrderedChainMapc#~Kt}|jD]$}|D]}||vr|||V %dSr0)setmapsadd)r"seenmappingks    r__iter__z_OrderedChainMap.__iter__Os`uuy		G

D==HHQKKKGGG
		rN)r
rrrrrrrrNs#rrceZdZdZeZdZdZdZfdZ	dOdZ
dZd	Zd
Z
edZedZd
ZdZedZedZdZdZdZdZdZdZdZdZejefdZ dZ!dZ"dZ#dZ$dZ%dZ&dPd!Z'd"Z(ed#Z)d$Z*d%Z+d&Z,dPd'Z-dPd(Z.dPd)Z/d*Z0d+Z1d,Z2dQd-Z3dQd.Z4d/Z5dPd0Z6dPd1Z7dPd2Z8		dRd3Z9		dRd4Z:dQd5Z;d6Z<dPd7Z=dPd8Z>dPd9Z?dPd:Z@dPd;ZAdPd<ZBdPd=ZCdPd>ZDdPd?ZEdPd@ZFdPdAZGdPdBZHdPdCZIdPdDZJdPdEZKdPdFZLdPdGZMdPdHZNdPdIZOdJZPdKZQdPdLZRdPdMZSdNZTeTe7xZUZVeTe8xZWZXeTe9xZYZZeTe:xZ[Z\eTe/xZ]Z^eTe1Z_eTe.Z`eTePZaeTeRZbeTeSZcxZdS)STestCaseaWA class whose instances are single test cases.

    By default, the test code itself should be placed in a method named
    'runTest'.

    If the fixture may be used for many test cases, create as
    many test methods as are needed. When instantiating such a TestCase
    subclass, specify in the constructor arguments the name of the test method
    that the instance is to execute.

    Test authors should subclass TestCase for their own tests. Construction
    and deconstruction of the test's environment ('fixture') can be
    implemented by overriding the 'setUp' and 'tearDown' methods respectively.

    If it is necessary to override the __init__ method, the base class
    __init__ method must always be called. It is important that subclasses
    should not change the signature of their __init__ method, since instances
    of the classes are instantiated automatically by parts of the framework
    in order to be run.

    When subclassing TestCase, you can set these attributes:
    * failureException: determines which exception will be raised when
        the instance's assertion methods fail; test methods raising this
        exception will be deemed to have 'failed' rather than 'errored'.
    * longMessage: determines whether long messages (including repr of
        objects used in assert methods) will be printed on failure in *addition*
        to any explicit message passed.
    * maxDiff: sets the maximum length of a diff in failure messages
        by assert methods using difflib. It is looked up as an instance
        attribute so can be configured by individual tests if required.
    TiicVd|_g|_tj|i|dS)NF)_classSetupFailed_class_cleanupssuper__init_subclass__)rOrWrX	__class__s   rrzTestCase.__init_subclass__s5 % !!42622222rrunTestc:||_d|_d|_	t||}|j|_n0#t
$r#|dkrt
d|jd|YnwxYwg|_d|_	i|_
|td|td|td|td	|t d	|t"d
dS)zCreate an instance of the class that will use the named test
           method when executed. Raises a ValueError if the instance does
           not have a method with the specified name.
        NzNo testrzno such test method in : assertDictEqualassertListEqualassertTupleEqualassertSetEqualassertMultiLineEqual)_testMethodName_outcome_testMethodDocr6rrK
ValueErrorr	_cleanups_subtest_type_equality_funcsaddTypeEqualityFuncdictrrr	frozensetr()r"
methodName
testMethods   rr#zTestCase.__init__sA
 *
'		5 z22J#-"4D	4	4	4Y&&!j~~~zz"3444'&	4
%'!  '8999  '8999  (:;;;  &6777  ,<===  &<=====s4*A! A!c||j|<dS)a[Add a type specific assertEqual style function to compare a type.

        This method is for use by TestCase subclasses that need to register
        their own type equality functions to provide nicer error messages.

        Args:
            typeobj: The data type to call this function on when both values
                    are of the same type in assertEqual().
            function: The callable taking two arguments and an optional
                    msg= argument that raises self.failureException with a
                    useful error message when the two arguments are not equal.
        N)r)r"typeobjrVs   rrzTestCase.addTypeEqualityFuncs.6!'***rc@|j|||fdS)aAdd a function, with arguments, to be called when the test is
        completed. Functions added are called on a LIFO basis and are
        called after tearDown on test failure or success.

        Cleanup items are called even if setUp fails (unlike tearDown).N)rrUr"rVrWrXs    r
addCleanupzTestCase.addCleanups'	
xv677777rc,t||jS)zEnters the supplied context manager.

        If successful, also adds its __exit__ method as a cleanup
        function and returns the result of the __enter__ method.
        )rRr)r"rMs  renterContextzTestCase.enterContextsb$/222rc@|j|||fdS)zpSame as addCleanup, except the cleanup items are called even if
        setUpClass fails (unlike tearDownClass).N)rrUrOrVrWrXs    raddClassCleanupzTestCase.addClassCleanups(	""HdF#;<<<<<rc,t||jS)z%Same as enterContext, but class-wide.)rRr)rOrMs  renterClassContextzTestCase.enterClassContextsb#"5666rcdS)zAHook method for setting up the test fixture before exercising it.Nrrs rsetUpzTestCase.setUprcdS)zAHook method for deconstructing the test fixture after testing it.Nrrs rtearDownzTestCase.tearDownrrcdS)zKHook method for setting up class fixture before running tests in the class.NrrOs r
setUpClasszTestCase.setUpClassrcdS)zVHook method for deconstructing the class fixture after running all tests in the class.Nrrs r
tearDownClasszTestCase.tearDownClassrrcdS)Nrrrs rcountTestCaseszTestCase.countTestCasessqrc(tjSr0)r
TestResultrs rdefaultTestResultzTestCase.defaultTestResults """rc|j}|r?|ddndS)zReturns a one-line description of the test, or None if no
        description has been provided.

        The default implementation of this method returns the first line of
        the specified test method's docstring.
        
rN)rstripsplitr"docs  rshortDescriptionzTestCase.shortDescriptionsC!58Bsyy{{  &&q)//111dBrc>t|jd|jS)NrGrrrrs ridzTestCase.ids#"4>2222D4H4HIIrclt|t|urtS|j|jkSr0)rHNotImplementedrr"others  r__eq__zTestCase.__eq__s0::T%[[((!!#u'<<<rcHtt||jfSr0)hashrHrrs r__hash__zTestCase.__hash__sT$ZZ!56777rcP|jdt|jd|jdS)N (rG))rrrrs r__str__zTestCase.__str__s1#333Xdn5M5M5M5MtOcOcOcddrcBdt|jd|jdS)N<z testMethod=>rrs r__repr__zTestCase.__repr__s.(((($*>*>*>@	@rc+K|j|jjsdVdS|j}|t|}n|j|}t
||||_	|j|jd5dVdddn#1swxYwY|jjs|jj	}||j
rtn|jjrt||_dS#||_wxYw)aPReturn a context manager that will return the enclosed block
        of code in a subtest identified by the optional message and
        keyword parameters.  A failure in the subtest marks the test
        case as failed but resumes execution at the end of the enclosed
        block, allowing further test code to be executed.
        NT)r,)
rrrrparams	new_child_SubTestr/r rfailfastrr!)r"rr#parent
params_maprs      rr,zTestCase.subTestsI= 
(N EEEF>)&11JJ0088J sJ77
	#//
t/LL
















=(
"-%&/%%%.
""!"DMMMFDM""""s0&!C(BC(BC(B ?C((	C1c	|j}|||dS#t$r.tjdt|j|YdSwxYw)Nz@TestResult has no addExpectedFailure method, reporting as passes)addExpectedFailurerKr7r8r9r:)r"rr*r*s    r_addExpectedFailurezTestCase._addExpectedFailure&s~	/!'!:
tX.....	$	$	$M\(
*
*
*Fd######	$s4AAc	|j}||dS#t$rXtjdt	t
d#t
$r'|j|tjYYdSwxYwwxYw)NzCTestResult has no addUnexpectedSuccess method, reporting as failure)	addUnexpectedSuccessrKr7r8r9rr?r)r*)r"rr-s   r_addUnexpectedSuccesszTestCase._addUnexpectedSuccess0s	'#)#> 
! &&&&&	8	8	8M_(
*
*
*
8(d2%
8
8
8!!$7777777
8	8s&$A8A,A4/A83A44A8c.|dSr0)rrs r
_callSetUpzTestCase._callSetUp?s

rc^|"tjd|dtddSdS)NzFIt is deprecated to return a value that is not None from a test case (r)
stacklevel)r7r8DeprecationWarning)r"methods  r_callTestMethodzTestCase._callTestMethodBs\688M2(.2223ERS
U
U
U
U
U
U rc.|dSr0)rrs r
_callTearDownzTestCase._callTearDownGs

rc||i|dSr0rrs    r_callCleanupzTestCase._callCleanupJs$!&!!!!!rNc|C|}t|dd}t|dd}|
|nd}|j|	t||j}t|jddst|ddrWt|jddpt|dd}t|||||j|||SSt|ddpt|dd}t|}	||_|	|5|
dddn#1swxYwY|jr||_|	|5|
|dddn#1swxYwYd|_|	|5|dddn#1swxYwY||jrK|r9|jr|||jn&||n|j||d|_d}d|_|j|||SS#d|_d}d|_wxYw#|j|||wwxYw)NstartTestRunstopTestRunrjFrkrnrz)rr6	startTestrrr'stopTestrrr/r0r rr6r8
doCleanupsr!r+r.r:)r"rr<r=rskip_whyroutcomes        rrunzTestCase.runMs>++--F"6>4@@L!&->>K'K2	 t';<<J(;UCC

$7??
$DN4KRPPP&z3JBOOx000P
FOD!!!&



'M>FFM
$DeLL
v&&G
% '
--d33&&OO%%%&&&&&&&&&&&&&&&?-0AG- 11$7799,,Z88899999999999999905G- 11$77--**,,,---------------!!!?0(0"2? 44VW=TUUUU 66v>>>>))$///+/'!%

FOD!!!&



'+/'!%
$$$$
FOD!!!&



'sA5J(,1J(J:EJEJ"E#&J	F+J+F//J2F/3JG3'J3G77J:G7;A*J%J(J%%J((Kc|jp
t}|jrb|j\}}}||5|j|g|Ri|dddn#1swxYwY|jb|jS)zNExecute all cleanup functions. Normally called for you after
        tearDown.N)rrrr]r/r:r )r"rBrVrWrXs     rr@zTestCase.doCleanupss--8::n	=%)^%7%7%9%9"HdF))$//
=
=!!(<T<<<V<<<
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=n	=sA--A14A1cg|_|jrk|j\}}}	||i|n;#t$r.|jtjYnwxYw|jidSdS)zYExecute all class cleanup functions. Normally called for you after
        tearDownClass.N)tearDown_exceptionsrr]r^rUr)r*rs    rdoClassCleanupszTestCase.doClassCleanupss#%!	?%(%8%<%<%>%>"HdF
?$)&))))
?
?
?'..s|~~>>>>>
?	!	?	?	?	?	?s65A.-A.c|j|i|Sr0)rC)r"rWkwdss   r__call__zTestCase.__call__stx&&&&rct||j}t|jddst|ddr6t|jddpt|dd}t||||||jr7|j\}}}|j	|g|Ri||j5dSdS)z6Run the test without collecting errors in a TestResultrjFrkrnN)
r6rrrr0r6r8rr]r:)r"rrArVrWrXs      rdebugzTestCase.debugsT4#788
DN$7??	%J 3U;;	% 0GLLL":/FKK
8$$$Z(((n	9%)^%7%7%9%9"HdFDh8888888n	9	9	9	9	9rc t|)zSkip this test.re)r"r;s  rskipTestzTestCase.skipTestsvrc,||)z)Fail immediately, with the given message.)r>)r"rs  rfailz
TestCase.fails##C(((rc|r;||dt|z}||dS)z#Check that the expression is false.z%s is not falseNrrr>r"exprrs   rassertFalsezTestCase.assertFalsesI	-%%c+<y+NOOC'',,,	-	-rc|s;||dt|z}||dS)z"Check that the expression is true.z%s is not trueNrRrSs   r
assertTruezTestCase.assertTruesI	-%%c+;ioo+MNNC'',,,	-	-rc|js|p|S||S	|d|S#t$r$t|dt|cYSwxYw)aHonour the longMessage attribute when generating failure messages.
        If longMessage is False this means:
        * Use only an explicit message if it is provided
        * Otherwise use the standard message for the assert

        If longMessage is True:
        * Use the standard message
        * If an explicit message is provided, plus ' : ' and the explicit message
        Nz : )longMessageUnicodeDecodeErrorr)r"rrs   rrzTestCase._formatMessages	&%+%;	I!,SS11!	I	I	I!*;!7!7!7!73HHHH	Is+AAcdt||}	|d||d}S#d}wxYw)a=Fail unless an exception of class expected_exception is raised
           by the callable when invoked with specified positional and
           keyword arguments. If a different type of exception is
           raised, it will not be caught, and the test case will be
           deemed to have suffered an error, exactly as for an
           unexpected exception.

           If called with the callable and arguments omitted, will return a
           context object used like this::

                with self.assertRaises(SomeException):
                    do_something()

           An optional keyword argument 'msg' can be provided when assertRaises
           is used as a context object.

           The context manager keeps a reference to the exception as
           the 'exception' attribute. This allows you to inspect the
           exception after the assertion::

               with self.assertRaises(SomeException) as cm:
                   do_something()
               the_exception = cm.exception
               self.assertEqual(the_exception.error_code, 3)
        assertRaisesNrr)r"expected_exceptionrWrXcontexts     rr\zTestCase.assertRaisessB4''94@@	>>.$??GGdGNNNNs+/cPt||}|d||S)aFail unless a warning of class warnClass is triggered
           by the callable when invoked with specified positional and
           keyword arguments.  If a different type of warning is
           triggered, it will not be handled: depending on the other
           warning filtering rules in effect, it might be silenced, printed
           out, or raised as an exception.

           If called with the callable and arguments omitted, will return a
           context object used like this::

                with self.assertWarns(SomeWarning):
                    do_something()

           An optional keyword argument 'msg' can be provided when assertWarns
           is used as a context object.

           The context manager keeps a reference to the first matching
           warning as the 'warning' attribute; similarly, the 'filename'
           and 'lineno' attributes give you information about the line
           of Python code from which the warning was triggered.
           This allows you to inspect the warning after the assertion::

               with self.assertWarns(SomeWarning) as cm:
                   do_something()
               the_warning = cm.warning
               self.assertEqual(the_warning.some_attribute, 147)
        assertWarnsrr)r"expected_warningrWrXr_s     rrazTestCase.assertWarnss*8&&6==~~mT6:::rc,ddlm}||||dS)aFail unless a log message of level *level* or higher is emitted
        on *logger_name* or its children.  If omitted, *level* defaults to
        INFO and *logger* defaults to the root logger.

        This method must be used as a context manager, and will yield
        a recording object with two attributes: `output` and `records`.
        At the end of the context manager, the `output` attribute will
        be a list of the matching formatted log messages and the
        `records` attribute will be a list of the corresponding LogRecord
        objects.

        Example::

            with self.assertLogs('foo', level='INFO') as cm:
                logging.getLogger('foo').info('first message')
                logging.getLogger('foo.bar').error('second message')
            self.assertEqual(cm.output, ['INFO:foo:first message',
                                         'ERROR:foo.bar:second message'])
        r_AssertLogsContextFno_logs_logrfr"loggerlevelrfs    r
assertLogszTestCase.assertLogs"s0*	-,,,,,!!$uEEEErc,ddlm}||||dS)z Fail unless no log messages of level *level* or higher are emitted
        on *logger_name* or its children.

        This method must be used as a context manager.
        rreTrgrirks    rassertNoLogszTestCase.assertNoLogs:s0	-,,,,,!!$tDDDDrct|t|urP|jt|}|'t|trt||}|S|jS)aGet a detailed comparison function for the types of the two args.

        Returns: A callable accepting (first, second, msg=None) that will
        raise a failure exception if first != second with a useful human
        readable error message for those types.
        )rHrgetrgr(r6_baseAssertEqual)r"firstsecondasserters    r_getAssertEqualityFunczTestCase._getAssertEqualityFuncCsl";;$v,,&&044T%[[AAH#h,,7&tX66H$$rc||ks>dt||z}|||}||dS)z:The default assertEqual implementation, not type specific.%s != %sN)r	rr>)r"rtrurrs     rrszTestCase._baseAssertEqual]sP$';E6'J'JJK%%c;77C'',,,rcN|||}||||dS)z[Fail if the two objects are unequal as determined by the '=='
           operator.
        )rN)rw)r"rtrurassertion_funcs     rassertEqualzTestCase.assertEqualds644UFCCuf#......rc||ksJ||t|dt|}||dS)zYFail if the two objects are equal as determined by the '!='
           operator.
         == NrR)r"rtrurs    rassertNotEqualzTestCase.assertNotEqualkse%%c59I9I9I9I:CF:K:K:K,MNNC'',,,rc	||krdS||tdt||z
}|K||krdSt|dt|dt|dt|d}nO|d}t||dkrdSt|dt|d|d	t|d}|||}||)
a'Fail if the two objects are unequal as determined by their
           difference rounded to the given number of decimal places
           (default 7) and comparing to zero, or by comparing that the
           difference between the two objects is more than the given
           delta.

           Note that decimal places (from zero) are usually not the same
           as significant digits (measured from the most significant digit).

           If the two objects compare equal then they will automatically
           compare almost equal.
        N specify delta or places not bothz !=  within  delta ( difference)rz	 places (rLabsrroundrr>r"rtruplacesrdeltadiffrs        rassertAlmostEqualzTestCase.assertAlmostEqualts,F??F!3>???56>""u}}%    &!!!!%    $	!KK~T6""a''%    &!!!!$	!K
!!#{33##C(((rc	||tdt||z
}|Q||ks||krdSt|dt|dt|dt|d}nE|d}||kst||dkrdSt|dt|d|d	}|||}||)
aFail if the two objects are equal as determined by their
           difference rounded to the given number of decimal places
           (default 7) and comparing to zero, or by comparing that the
           difference between the two objects is less than the given delta.

           Note that decimal places (from zero) are usually not the same
           as significant digits (measured from the most significant digit).

           Objects that are equal automatically fail.
        Nrr~rrrrrz placesrrs        rassertNotAlmostEqualzTestCase.assertNotAlmostEquals!3>???56>""VOO%    &!!!!%    $	!KK~VOOtV)<)<)A)A9B59I9I9I9I9B69J9J9J9J9?AK!!#{33##C(((rc	|x|j}t||s(|d|dt|t||s(|d|dt|nd}d}	t	|}n#t
tf$rd|z}YnwxYw|-	t	|}n#t
tf$rd|z}YnwxYw|||krdSd|ft||zz}tt||D]}		||	}
n(#t
ttf$r|d	|	|fzz
}YnwxYw	||	}n(#t
ttf$r|d
|	|fzz
}YnQwxYw|
|kr|d|	ft|
|zzz
}n+||kr$|"t|t|krdS||krS|d|||z
fzz
}	|d
|t||fzz
}n#t
ttf$r
|d||fzz
}Yn]wxYw||krS|d|||z
fzz
}	|d
|t||fzz
}n'#t
ttf$r
|d||fzz
}YnwxYw|}dd
tjt!j|t!j|z}
|||
}|||}||dS)aAAn equality assertion for ordered sequences (like lists and tuples).

        For the purposes of this function, a valid ordered sequence type is one
        which can be indexed, has a length, and has an equality operator.

        Args:
            seq1: The first sequence to compare.
            seq2: The second sequence to compare.
            seq_type: The expected datatype of the sequences, or None if no
                    datatype should be enforced.
            msg: Optional message to use on failure instead of a list of
                    differences.
        NzFirst sequence is not a rzSecond sequence is not a sequencez(First %s has no length.    Non-sequence?z)Second %s has no length.    Non-sequence?z%ss differ: %s != %s
z(
Unable to index element %d of first %s
z)
Unable to index element %d of second %s
z#
First differing element %d:
%s
%s
z+
First %s contains %d additional elements.
zFirst extra element %d:
%s
z'Unable to index element %d of first %s
z,
Second %s contains %d additional elements.
z(Unable to index element %d of second %s
r	)r
rgr>rlenrLNotImplementedError
capitalizer	rangemin
IndexErrorrHjoindifflibndiffpprintpformat
splitlines_truncateMessagerrP)r"seq1seq2rseq_type
seq_type_name	differinglen1len2iitem1item2rdiffMsgs              rassertSequenceEqualzTestCase.assertSequenceEquals$-MdH--
L++++8==)D///-KLLLdH--
L++++8==)D///-KLLL
L'M		#t99DD./	#	#	#B!#III	#
'4yy23
'
'
'G%'			
't||0"--//1(t4456I3tT??++

 GEE!:/BC"N"#]!3#45IEE
 GEE!:/BC"O"#]!3#45IEE
E>>"K#$$)=eU)K)K"K#MNIE"
DLLX%5JJ$t**,,Fd{{+.;TD[-IJK	K"A#'4:)>)>"?#@AII!:/BCKKK#259=4I#JKIIIK+.;TD[-IJK	L"A#'4:)>)>"?#@AII!:/BCLLL#36:M5J#KLIIIL M&...99;; ...99;;
=
=>>>++KAA!!#{33		#slBB)(B)/B??CC/D88!EE!E**!FF3H!H54H5I**!J
Jcx|j}|t||kr||zS|tt|zzSr0)maxDiffrDIFF_OMITTED)r"rrmax_diffs    rrzTestCase._truncateMessage's?<s4yyH44T>!,T233rcB||||tdS)aA list-specific equality assertion.

        Args:
            list1: The first list to compare.
            list2: The second list to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.

        rN)rr)r"list1list2rs    rrzTestCase.assertListEqual-s'	
  sT BBBBBrcB||||tdS)aA tuple-specific equality assertion.

        Args:
            tuple1: The first tuple to compare.
            tuple2: The second tuple to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.
        rN)rr)r"tuple1tuple2rs    rrzTestCase.assertTupleEqual9s'	
  u EEEEErcJ	||}nY#t$r"}|d|zYd}~n2d}~wt$r"}|d|zYd}~nd}~wwxYw	||}nY#t$r"}|d|zYd}~n2d}~wt$r"}|d|zYd}~nd}~wwxYw|s|sdSg}|r<|d|D]$}|t|%|r<|d|D]$}|t|%d|}	||||	dS)aA set-specific equality assertion.

        Args:
            set1: The first set to compare.
            set2: The second set to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.

        assertSetEqual uses ducktyping to support different types of sets, and
        is optimized for sets specifically (parameters must support a
        difference method).
        z/invalid type when attempting set difference: %sNz2first argument does not support set difference: %sz3second argument does not support set difference: %sz*Items in the first set but not the second:z*Items in the second set but not the first:r	)
differencerLrPrKrUreprrr)
r"set1set2rdifference1r.difference2linesitemrs
          rrzTestCase.assertSetEqualDs&	P//$//KK	M	M	MIIG!KLLLLLLLL	P	P	PIIJQNOOOOOOOO	P	Q//$//KK	M	M	MIIG!KLLLLLLLL	Q	Q	QIIKaOPPPPPPPP	Q	{	F	)LLEFFF#
)
)T$ZZ((((	)LLEFFF#
)
)T$ZZ((((ii&&		$%%c;7788888sB
A.?
A.A))A.2B
CB//
C<CCc||vrLt|dt|}||||dSdS)zDJust like self.assertTrue(a in b), but with a nicer default message. not found in NrrPrr"member	containerrrs     rassertInzTestCase.assertInosd""2;F2C2C2C2C2;I2F2F2FHKIId))#{;;<<<<<#"rc||vrLt|dt|}||||dSdS)zHJust like self.assertTrue(a not in b), but with a nicer default message.z unexpectedly found in Nrrs     rassertNotInzTestCase.assertNotInvsdY;DV;L;L;L;L8A)8L8L8LNKIId))#{;;<<<<<rc||urLt|dt|}||||dSdS)zDJust like self.assertTrue(a is b), but with a nicer default message.z is not Nrr"expr1expr2rrs     rassertIszTestCase.assertIs}sc,5e,<,<,<,<-6u-=-=-=?KIId))#{;;<<<<<rc||ur=dt|}||||dSdS)zHJust like self.assertTrue(a is not b), but with a nicer default message.zunexpectedly identical: Nrrs     rassertIsNotzTestCase.assertIsNotsOE>>>:CE:J:J:JLKIId))#{;;<<<<<>rc	||td||td||krdt||z}ddt	jt
j|t
j|z}|	||}|
|||dSdS)Nz"First argument is not a dictionaryz#Second argument is not a dictionaryryr	)assertIsInstancerr	rrrrrrrrPr)r"d1d2rrrs      rrzTestCase.assertDictEqualsb$(LMMMb$(MNNN
88$';B'C'CCK499W]!>"--88::!>"--88::&<&<===D//TBBKIId))#{;;<<<<<
8rcHtjdtg}g}|D]u\}}||vr|||||krJ|t|dt|dt||v|s|sdSd}|r"ddd|Dz}|r"|r|d	z
}|d
d|zz
}||||dS)z2Checks whether dictionary is a superset of subset.z&assertDictContainsSubset is deprecatedz, expected: z
, actual: NrnzMissing: %s,c34K|]}t|VdSr0)r)r~rs  rrz4TestCase.assertDictContainsSubset.<locals>.<genexpr>s83=3=A9Q<<3=3=3=3=3=3=rz; zMismatched values: %s)	r7r8r4itemsrUrrrPr)	r"subset
dictionaryrmissing
mismatchedkeyvaluers	         rassertDictContainsSubsetz!TestCase.assertDictContainsSubsetsz
>(	*	*	*
 ,,..	@	@JC*$$s####*S/))!!#,S>>>>9U3C3C3C3C#,Z_#=#=#=#?@@@	:	F	='#((3=3=4;3=3=3=+=+==K	J
$t#2SXXj5I5IIIK		$%%c;7788888rct|t|}}	tj|}tj|}||krdSt||}n #t$rt||}YnwxYw|rfd}d|D}d|}	|||	}|||}|	|dSdS)a[Asserts that two iterables have the same elements, the same number of
        times, without regard to order.

            self.assertEqual(Counter(list(first)),
                             Counter(list(second)))

         Example:
            - [0, 1, 1] and [1, 0, 1] compare equal.
            - [0, 0, 1] and [0, 1] compare unequal.

        NzElement counts were not equal:
cg|]}d|zS)z First has %d, Second has %d:  %rr)r~rs  r
<listcomp>z-TestCase.assertCountEqual.<locals>.<listcomp>sWWW47$>WWWrr	)
rcollectionsCounterrrLrrrrrP)
r"rtrur	first_seq
second_seqdifferencesrrrs
          rassertCountEqualzTestCase.assertCountEquals!%UT&\\:			F'	22E (44F
.y*EEKK
	I	I	I1)ZHHKKK	I	<KWW;WWWEii&&G//WEEK%%c;77CIIcNNNNN
		s(A!!A>=A>c||td||td||kr*t||jkst||jkr|||||d}|d}t|dkr%|d|kr|dzg}|dzg}dt||z}dd	tj
||z}|||}||
||d
Sd
S)z-Assert that two multi-line strings are equal.zFirst argument is not a stringzSecond argument is not a stringT)keependsrz
r	ryrnN)rr(r_diffThresholdrsrr
r	rrrrrPr)r"rtrur
firstlinessecondlinesrrs        rrzTestCase.assertMultiLineEqualsaeS*JKKKfc+LMMMF??E

T000Fd111%%eVS999))4)88J ++T+::K:!##F(;(;u(D(D#dl^
%}o$';E6'J'JJK"'''-
K"H"HIIID//TBBKIId))#{;;<<<<<?rc||ksLt|dt|}||||dSdS)zCJust like self.assertTrue(a < b), but with a nicer default message.z not less than Nrr"abrrs     r
assertLesszTestCase.assertLesssV1uu3<Q<<<<1NKIId))#{;;<<<<<urc||ksLt|dt|}||||dSdS)zDJust like self.assertTrue(a <= b), but with a nicer default message.z not less than or equal to Nrrs     rassertLessEqualzTestCase.assertLessEqualsWAvv?H||||YWX\\\ZKIId))#{;;<<<<<vrc||ksLt|dt|}||||dSdS)zCJust like self.assertTrue(a > b), but with a nicer default message.z not greater than Nrrs     r
assertGreaterzTestCase.assertGreatersV1uu6?llllIaLLLQKIId))#{;;<<<<<urc||ksLt|dt|}||||dSdS)zDJust like self.assertTrue(a >= b), but with a nicer default message.z not greater than or equal to Nrrs     rassertGreaterEqualzTestCase.assertGreaterEquals[AvvBKA,,,,PYZ[P\P\P\]KIId))#{;;<<<<<vrc|=t|d}||||dSdS)zCSame as self.assertTrue(obj is None), with a nicer default message.Nz is not Nonerr"rCrrs    rassertIsNonezTestCase.assertIsNonesH?.7nnnn>KIId))#{;;<<<<<?rcd|-d}||||dSdS)z(Included for symmetry with assertIsNone.Nzunexpectedly None)rPrrs    rassertIsNotNonezTestCase.assertIsNotNones;;-KIId))#{;;<<<<<;rct||s?t|d|}||||dSdS)zTSame as self.assertTrue(isinstance(obj, cls)), with a nicer
        default message.z is not an instance of NrgrrPrr"rCrOrrs     rrzTestCase.assertIsInstances^#s##	=;DS>>>>33OKIId))#{;;<<<<<	=	=rct||r?t|d|}||||dSdS)z,Included for symmetry with assertIsInstance.z is an instance of Nrrs     rassertNotIsInstancezTestCase.assertNotIsInstances\c3	=7@~~~~ssKKIId))#{;;<<<<<	=	=rcRt|||}|d||S)aAsserts that the message in a raised exception matches a regex.

        Args:
            expected_exception: Exception class expected to be raised.
            expected_regex: Regex (re.Pattern object or string) expected
                    to be found in error message.
            args: Function to be called and extra positional args.
            kwargs: Extra kwargs.
            msg: Optional message used in case of failure. Can only be used
                    when assertRaisesRegex is used as a context manager.
        assertRaisesRegexr])r"r^rrWrXr_s      rrzTestCase.assertRaisesRegexs-''94PP~~14@@@rcRt|||}|d||S)aAsserts that the message in a triggered warning matches a regexp.
        Basic functioning is similar to assertWarns() with the addition
        that only warnings whose messages also match the regular expression
        are considered successful matches.

        Args:
            expected_warning: Warning class expected to be triggered.
            expected_regex: Regex (re.Pattern object or string) expected
                    to be found in error message.
            args: Function to be called and extra positional args.
            kwargs: Extra kwargs.
            msg: Optional message used in case of failure. Can only be used
                    when assertWarnsRegex is used as a context manager.
        assertWarnsRegexrb)r"rcrrWrXr_s      rrzTestCase.assertWarnsRegex(s- &&6nMM~~0$???rct|ttfr |s
Jdtj|}||s8d|jd|}|||}||dS)z=Fail the test unless the text matches the regular expression.z!expected_regex must not be empty.zRegex didn't match: rN)	rgr(bytesrrrrrr>)r"textrrrs     rassertRegexzTestCase.assertRegex;snsEl33	8!FF#FFFFZ77N$$T**	-	-&&&.K%%c;77C'',,,	-	-rcbt|ttfrtj|}||}|rgd|||d|jd|}|	||}|
|dS)z9Fail the test if the text matches the regular expression.zRegex matched: z	 matches z in N)rgr(rrrrstartendrrr>)r"runexpected_regexrmatchrs      rassertNotRegexzTestCase.assertNotRegexGs&e55	<!z*:;; ''--	-	-U[[]]UYY[[0111 (((K
%%c;77C'',,,	-	-rcfd}|S)Ncztjdjtd|i|S)NzPlease use {0} instead.r5)r7r8rr
r4)rWrX
original_funcs  rdeprecated_funcz,TestCase._deprecate.<locals>.deprecated_funcWsGM)001GHH"A
'
'
'!=$1&111rr)rrs` r
_deprecatezTestCase._deprecateVs$	2	2	2	2	2
r)rr0)NNNNN)er
rrrAssertionErrorr>rYrrrr#rrrrrrrrrrrrrrrrrr!r1r2_subtest_msg_sentinelr,r+r.r0r6r8r:rCr@rGrJrLrNrPrUrWrr\rarnrprwrsr|rrrrrrrrrrrrrrrrrrrrrrrrrrrrrfailUnlessEqualassertEqualsfailIfEqualassertNotEqualsfailUnlessAlmostEqualassertAlmostEqualsfailIfAlmostEqualassertNotAlmostEquals
failUnlessassert_failUnlessRaisesfailIfassertRaisesRegexpassertRegexpMatchesassertNotRegexpMatches
__classcell__rs@rrrXs@&KGN33333>>>>@
6
6
6888333==[=
77[7





VV[Vaa[a###CCCJJJ===888eee@@@/####<///
'
'
'UUU
"""====~	?	?[	?'''999"))))--------III*B;;;>FFFF0EEEE%%%4----////----AE $+)+)+)+)ZDH#'!)!)!)!)FaaaaF444
C
C
C
C	F	F	F	F)9)9)9)9V================
=
=
=
=9999:@====(================================AAA @@@&
-
-
-
-----&0Z%<%<<Ol$.J~$>$>>K/1;<M1N1NN.0:
;O0P0PP-%:j111J!z,//
Z
$
$F#$566$*[11'Z77rrcZeZdZdZd
fd	ZdZdZdZdZdZ	d	Z
d
ZdZdZ
xZS)FunctionTestCaseaIA test case that wraps a test function.

    This is useful for slipping pre-existing test functions into the
    unittest framework. Optionally, set-up and tidy-up functions can be
    supplied. As with TestCase, the tidy-up ('tearDown') function will
    always be called if the set-up ('setUp') function ran successfully.
    Nctt|||_||_||_||_dSr0)rr)r#
_setUpFunc
_tearDownFunc	_testFunc_description)r"testFuncrrdescriptionrs     rr#zFunctionTestCase.__init__usD
%%..000%!'rc@|j|dSdSr0)r+rs rrzFunctionTestCase.setUp|s(?&OO'&rc@|j|dSdSr0)r,rs rrzFunctionTestCase.tearDowns+)     *)rc.|dSr0)r-rs rrzFunctionTestCase.runTestsrc|jjSr0)r-r
rs rrzFunctionTestCase.ids
~&&rct||jstS|j|jko/|j|jko|j|jko|j|jkSr0)rgrrr+r,r-r.rs  rrzFunctionTestCase.__eq__sg%00	"!!%"227!U%887~07 E$66	7rcltt||j|j|j|jfSr0)rrHr+r,r-r.rs rrzFunctionTestCase.__hash__s4T$ZZ$2D^T%6899	9rcJt|jd|jjdS)Nrr)rrr-r
rs rrzFunctionTestCase.__str__s-$T^4444 N3335	5rcBdt|jd|jdS)Nrz tec=r )rrr-rs rr!zFunctionTestCase.__repr__s* ( 8 8 8 8%)^^^5	5rc|j|jS|jj}|r-|ddpdS)Nr	r)r.r-rrr
rs  rrz!FunctionTestCase.shortDescriptionsI($$n$1syyq)//119T9rr)r
rrrr#rrrrrrrr!rr&r's@rr)r)ls((((((!!!'''777999555555:::::::rr)c<eZdZfdZdZdZdZdZdZxZ	S)r%ct||_||_||_|j|_dSr0)rr#_messager%r#r>)r"r%rr#rs    rr#z_SubTest.__init__s?

" ) :rc td)Nzsubtests cannot be run directly)rrs rrz_SubTest.runTests!"CDDDrctg}|jtur-|d|j|jr^dd|jD}|d|d|pdS)Nz[{}]z, c3HK|]\}}d||VdS)z{}={!r}N)r)r~rrs   rrz+_SubTest._subDescription.<locals>.<genexpr>sJ$3$3Q  A&&$3$3$3$3$3$3rz({}) z(<subtest>))r<rrUrr#rr)r"partsparams_descs   r_subDescriptionz_SubTest._subDescriptions= 555LLt}55666;	5))$3$3"k//11$3$3$333K
LL{33444xx/-/rcd|j|SNz{} {})rr%rrCrs rrz_SubTest.ids0~~dn//1143G3G3I3IJJJrc4|jS)zlReturns a one-line description of the subtest, or None if no
        description has been provided.
        )r%rrs rrz_SubTest.shortDescriptions~..000rc\d|j|SrE)rr%rCrs rrz_SubTest.__str__s$~~dnd.B.B.D.DEEEr)
r
rrr#rrCrrrr&r's@rr%r%s;;;;;EEE	0	0	0KKK111FFFFFFFrr%)2rr)rhrrrr7rr1rrornrutilrrrrr	
__unittestobjectrrr^rrrrr'r+rDrRrTrYr[rarqrvrxr!r}rrrrChainMaprrr)r%rrr<module>rLs







				??????????????
7y)
&8&8&8&8&8v&8&8&8R%%%,,,666
000



 (III
33333333'''''3'''T$8$8$8$8$83$8$8$8N1D1D1D1D1D21D1D1Dh{+P8P8P8P8P8vP8P8P8h 7:7:7:7:7:x7:7:7:t!F!F!F!F!Fx!F!F!F!F!Fr