o 0¦iPáã@s� ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZmZmZmZdZeƒZdZGdd„deƒZGd d „d eƒZGd d „d eƒZGd d„deƒZdd„ZgZdd„Zdd„Zdd„Zdd„Z dd„Z!dd„Z"dd„Z#Gdd „d ƒZ$Gd!d"„d"e$ƒZ%Gd#d$„d$e%ƒZ&Gd%d&„d&e%ƒZ'Gd'd(„d(ej(ƒZ)Gd)d*„d*eƒZ*Gd+d,„d,e*ƒZ+Gd-d.„d.e*ƒZ,dS)/éNé)Ú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.c@ó eZdZdS)ÚSkipTestN©Ú__name__Ú __module__Ú __qualname__©rrú4/opt/alt/python310/lib64/python3.10/unittest/case.pyr ór c@r )Ú _ShouldStopNr rrrrr!rrc@r )Ú_UnexpectedSuccessNr rrrrr&rrc@s&eZdZddd„Zejddd„ƒZdS) Ú_OutcomeNcCs4d|_||_t|dƒ|_d|_g|_d|_g|_dS)NFÚ addSubTestT)Úexpecting_failurerÚhasattrÚresult_supports_subtestsÚsuccessÚskippedÚexpectedFailureÚerrors)ÚselfrrrrÚ__init__-s  z_Outcome.__init__Fc csì�|j}d|_zgzdVWnJty‚ty3}zd|_|j |t|ƒf¡WYd}~n7d}~wty;Yn+t ¡}|j rI||_ n d|_|j  ||f¡d}Yn|j rf|jrf|j  |df¡W|jok||_dS|jos||_w)NTF) rÚKeyboardInterruptr rÚappendÚstrrÚsysÚexc_inforrrr)rÚ test_caseÚisTestZ old_successÚer#rrrÚtestPartExecutor6s0€   €  €z_Outcome.testPartExecutor©N)F)r r rrÚ contextlibÚcontextmanagerr'rrrrr,s  rcCó|Sr(r)ÚobjrrrÚ_idTór-cOs t |||f¡dSr()Ú_module_cleanupsr )ÚfunctionÚargsÚkwargsrrrÚaddModuleCleanupYsr3c Csn g}tr/t ¡\}}}z ||i|¤ŽWnty,}z | |¡WYd}~nd}~wwts|r5|d‚dS©Nr)r/ÚpopÚ Exceptionr )Ú exceptionsr0r1r2ÚexcrrrÚdoModuleCleanups_s€ÿüýr9cs. ‡fdd„}tˆtjƒrˆ}d‰||ƒS|S)Ncs4t|tƒst |¡‡fdd„ƒ}|}d|_ˆ|_|S)Ncstˆƒ‚r(©r ©r1r2©ÚreasonrrÚ skip_wrapperusz-skip..decorator..skip_wrapperT)Ú isinstanceÚtypeÚ functoolsÚwrapsÚ__unittest_skip__Ú__unittest_skip_why__)Ú test_itemr>r<rrÚ decoratorss zskip..decoratorÚ)r?ÚtypesÚ FunctionType)r=rFrErr<rÚskipos  rJcCs |rt|ƒStSr(©rJr-©Z conditionr=rrrÚskipIfƒórMcCs |st|ƒStSr(rKrLrrrÚ skipUnless‹rNrOcCs d|_|S)NT)Ú__unittest_expecting_failure__)rErrrr“srcs4t|tƒrt‡fdd„|DƒƒSt|tƒot|ˆƒS)Nc3s�|]}t|ˆƒVqdSr()Ú _is_subtype)Ú.0r&©ÚbasetyperrÚ ™s€z_is_subtype..)r?ÚtupleÚallr@Ú issubclass)ÚexpectedrTrrSrrQ—s rQc@seZdZdd„Zdd„ZdS)Ú_BaseTestCaseContextcCs ||_dSr()r$)rr$rrrržó z_BaseTestCaseContext.__init__cCs|j |j|¡}|j |¡‚r()r$Ú_formatMessageÚmsgÚfailureException)rÚ standardMsgr]rrrÚ _raiseFailure¡s z"_BaseTestCaseContext._raiseFailureN)r r rrr`rrrrrZœs rZc@seZdZddd„Zdd„ZdS)Ú_AssertRaisesBaseContextNcCs@t ||¡||_||_|durt |¡}||_d|_d|_dSr() rZrrYr$ÚreÚcompileÚexpected_regexÚobj_namer])rrYr$rdrrrr§s   z!_AssertRaisesBaseContext.__init__cCsØ zgt|j|jƒstd||jfƒ‚|s-| dd¡|_|r(tdtt|ƒƒfƒ‚|Wd}S|^}}z|j |_ Wnt yEt |ƒ|_ Ynw|�||i|¤ŽWdƒn 1sZwYWd}dSWd}dSd}w)Nz%s() arg 1 must be %sr]z3%r is an invalid keyword argument for this function) rQrYÚ _base_typeÚ TypeErrorÚ_base_type_strr5r]ÚnextÚiterr reÚAttributeErrorr!)rÚnamer1r2Z callable_objrrrÚhandle±s4ÿ ÿ ÷  ÿÿüz_AssertRaisesBaseContext.handler()r r rrrmrrrrra¥s  rac@s0eZdZ eZdZdd„Zdd„Zee j ƒZ dS)Ú_AssertRaisesContextz-an exception type or tuple of exception typescCr+r(r©rrrrÚ __enter__Õr.z_AssertRaisesContext.__enter__cCsÄ|dur0z|jj}Wntyt|jƒ}Ynw|jr'| d ||j¡¡n| d |¡¡nt |¡t ||jƒs=dS|  d¡|_ |j durJdS|j }|  t|ƒ¡s`| d |jt|ƒ¡¡dS)Nz{} not raised by {}z {} not raisedFTú"{}" does not match "{}")rYr rkr!rer`ÚformatÚ tracebackÚ clear_framesrXÚwith_tracebackZ exceptionrdÚsearchÚpattern)rÚexc_typeÚ exc_valueÚtbÚexc_namerdrrrÚ__exit__Øs.  ÿ ÿ     ÿz_AssertRaisesContext.__exit__N) r r rÚ BaseExceptionrfrhrpr|Ú classmethodrHÚ GenericAliasÚ__class_getitem__rrrrrnÏsrnc@s&eZdZ eZdZdd„Zdd„ZdS)Ú_AssertWarnsContextz(a warning type or tuple of warning typescCsRttj ¡ƒD] }t|ddƒri|_qtjdd�|_|j  ¡|_t  d|j ¡|S)NÚ__warningregistry__T)ÚrecordÚalways) Úlistr"ÚmodulesÚvaluesÚgetattrr‚ÚwarningsÚcatch_warningsÚwarnings_managerrpÚ simplefilterrY)rÚvrrrrpüs € z_AssertWarnsContext.__enter__cCs|j |||¡|durdSz|jj}Wnty"t|jƒ}Ynwd}|jD]-}|j}t||jƒs4q(|dur:|}|j durH|j   t|ƒ¡sHq(||_ |j |_ |j |_ dS|durg| d |j jt|ƒ¡¡|jrv| d ||j¡¡dS| d |¡¡dS)Nrqz{} not triggered by {}z{} not triggered)r‹r|rYr rkr!r‰Úmessager?rdrvZwarningÚfilenameÚlinenor`rrrwre)rrxryrzr{Zfirst_matchingÚmÚwrrrr|s@  ÿ   ÿ ÿ  ÿz_AssertWarnsContext.__exit__N)r r rÚWarningrfrhrpr|rrrrr�ös  r�c@seZdZdd„ZdS)Ú_OrderedChainMapccs:�tƒ}|jD]}|D]}||vr| |¡|Vq qdSr()ÚsetÚmapsÚadd)rÚseenÚmappingÚkrrrÚ__iter__+s€  €ýÿz_OrderedChainMap.__iter__N)r r rr›rrrrr”*s r”cs0eZdZ eZdZdZdZ‡fdd„Zd–dd„Z d d „Z d d „Z e d d„ƒZ dd„Zdd„Ze dd„ƒZe dd„ƒZdd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zejefd)d*„ƒZd+d,„Zd-d.„Z d/d0„Z!d1d2„Z"d3d4„Z#d5d6„Z$d7d8„Z%d—d:d;„Z&dd?„ƒZ(d@dA„Z)dBdC„Z*dDdE„Z+d—dFdG„Z,d—dHdI„Z-d—dJdK„Z.dLdM„Z/dNdO„Z0dPdQ„Z1d˜dRdS„Z2d˜dTdU„Z3dVdW„Z4d—dXdY„Z5d—dZd[„Z6d—d\d]„Z7 9 9d™d^d_„Z8 9 9d™d`da„Z9d˜dbdc„Z:ddde„Z;d—dfdg„Zd—dldm„Z?d—dndo„Z@d—dpdq„ZAd—drds„ZBd—dtdu„ZCd—dvdw„ZDd—dxdy„ZEd—dzd{„ZFd—d|d}„ZGd—d~d„ZHd—d€d�„ZId—d‚dƒ„ZJd—d„d…„ZKd—d†d‡„ZLd—dˆd‰„ZMd—dŠd‹„ZNdŒd�„ZOdŽd�„ZPd—d�d‘„ZQd—d’d“„ZRd”d•„ZSeSe6ƒZTZUeSe7ƒZVZWeSe8ƒZXZYeSe9ƒZZZ[eSe.ƒZ\Z]eSe0ƒZ^eSe-ƒZ_eSeOƒZ`eSeQƒZaeSeRƒZb‡ZcS)šÚTestCaseTi€ics"d|_g|_tƒj|i|¤ŽdS)NF)Z_classSetupFailedÚ_class_cleanupsÚsuperÚ__init_subclass__)Úclsr1r2©Ú __class__rrrŸ_szTestCase.__init_subclass__ÚrunTestcCs¶ ||_d|_d|_zt||ƒ}Wnty'|dkr%td|j|fƒ‚Ynw|j|_g|_d|_ i|_ |  t d¡|  t d¡|  td¡|  td¡|  td¡|  td¡dS) NzNo testr£zno such test method in %s: %sÚassertDictEqualÚassertListEqualÚassertTupleEqualÚassertSetEqualÚassertMultiLineEqual)Ú_testMethodNameÚ_outcomeÚ_testMethodDocrˆrkÚ ValueErrorr¢Ú__doc__Ú _cleanupsÚ_subtestÚ_type_equality_funcsÚaddTypeEqualityFuncÚdictr…rVr•Ú frozensetr!)rZ methodNameÚ testMethodrrrres. ÿýÿ     zTestCase.__init__cCs ||j|<dSr()r°)rZtypeobjr0rrrr±…s zTestCase.addTypeEqualityFunccOó |j |||f¡dSr()r®r ©rr0r1r2rrrÚ addCleanup”szTestCase.addCleanupcOrµr()r�r ©r r0r1r2rrrÚaddClassCleanupœszTestCase.addClassCleanupcCó dSr(rrorrrÚsetUp¢ózTestCase.setUpcCrºr(rrorrrÚtearDown¦r¼zTestCase.tearDowncCódSr(r©r rrrÚ setUpClassªózTestCase.setUpClasscCr¾r(rr¿rrrÚ tearDownClass®rÁzTestCase.tearDownClasscCsdS)NrrrorrrÚcountTestCases²r.zTestCase.countTestCasescCst ¡Sr()rZ TestResultrorrrÚdefaultTestResultµózTestCase.defaultTestResultcCs& |j}|r| ¡ d¡d ¡SdS©NÚ r)r«ÚstripÚsplit©rÚdocrrrÚshortDescription¸szTestCase.shortDescriptioncCódt|jƒ|jfS)Nz%s.%s©rr¢r©rorrrÚidÃóz TestCase.idcCs t|ƒt|ƒur tS|j|jkSr()r@ÚNotImplementedr©©rÚotherrrrÚ__eq__Æs zTestCase.__eq__cCstt|ƒ|jfƒSr()Úhashr@r©rorrrÚ__hash__ÌózTestCase.__hash__cCsd|jt|jƒfS©Nz%s (%s))r©rr¢rorrrÚ__str__ÏrÐzTestCase.__str__cCrÍ)Nz<%s testMethod=%s>rÎrorrrÚ__repr__ÒsÿzTestCase.__repr__cCs>t|ddƒ}|dur|||ƒdSt dtd¡| |¡dS)NÚaddSkipz4TestResult has no addSkip method, skips not reportedé)rˆr‰ÚwarnÚRuntimeWarningÚ addSuccess)rrr$r=rÛrrrÚ_addSkipÖs ÿzTestCase._addSkipcksÜ� |jdus |jjsdVdS|j}|durt|ƒ}n|j |¡}t|||ƒ|_z@|jj|jdd�� dVWdƒn1sAwY|jjsX|jj }|durW|j rWt ‚n |jj r^t ‚W||_dSW||_dS||_w)NT©r%) rªrr¯r”ÚparamsÚ new_childÚ_SubTestr'rrZfailfastrr)rr]râÚparentZ params_maprrrrÚsubTestßs2€  ÿ€ý €zTestCase.subTestcCs`|D]+\}}t|tƒr| |j||¡q|dur-t|d|jƒr'| ||¡q| ||¡qdSr4)r?rärr$rXr^Ú addFailureZaddError)rrrÚtestr#rrrÚ_feedErrorsToResultþs   €ùzTestCase._feedErrorsToResultcCsDz|j}Wntyt dt¡| |¡YdSw|||ƒdS)Nz@TestResult has no addExpectedFailure method, reporting as passes)ÚaddExpectedFailurerkr‰rÝrÞrß)rrr#rêrrrÚ_addExpectedFailures  ÿýzTestCase._addExpectedFailurec Cs`z|j}Wn$ty)t dt¡ztd‚ty(| |t ¡¡YYdSww||ƒdS)NzCTestResult has no addUnexpectedSuccess method, reporting as failure) ÚaddUnexpectedSuccessrkr‰rÝrÞrrçr"r#)rrrìrrrÚ_addUnexpectedSuccesss  ÿ ÿù zTestCase._addUnexpectedSuccesscCó | ¡dSr()r»rorrrÚ _callSetUp!ó zTestCase._callSetUpcCs |ƒdSr(r)rÚmethodrrrÚ_callTestMethod$r[zTestCase._callTestMethodcCrîr()r½rorrrÚ _callTearDown'rðzTestCase._callTearDowncOs||i|¤ŽdSr(rr¶rrrÚ _callCleanup*r×zTestCase._callCleanupNc Csh|dur| ¡}t|ddƒ}t|ddƒ}|dur|ƒnd}| |¡�zt||jƒ}t|jddƒs8t|ddƒr\t|jddƒpDt|ddƒ}| |||¡|W| |¡|dur[|ƒSSt|ddƒpgt|ddƒ}t|ƒ}z¬||_|  |¡� |  ¡Wdƒn1s„wY|j rÇ||_ |j |dd �� |  |¡Wdƒn1s¦wYd|_ |  |¡� | ¡Wdƒn1sÂwY| ¡|jD] \}} | ||| ¡qÎ| ||j¡|j rü|r÷|jrñ| ||j¡n | |¡n| |¡|W|j ¡d|_d|_W| |¡|du�r|ƒSS|j ¡d|_d|_w| |¡|du�r3|ƒww) NÚ startTestRunÚ stopTestRunrCFrDrGrPTrá)rÄrˆZ startTestr©r¢ràZstopTestrrªr'rïrrròróÚ doCleanupsrrérrrërírßÚclear) rrrõrör´Úskip_whyrÚoutcomerèr=rrrÚrun-s„  €   ÿ ÿ ,ÿ Ö þ  ÿ ÿ  ÿ     ÿ ø  ÿz TestCase.runcCsr |jptƒ}|jr6|j ¡\}}}| |¡�|j|g|¢Ri|¤ŽWdƒn1s.wY|js |jSr()rªrr®r5r'rôr)rrúr0r1r2rrrr÷ps  ÿþzTestCase.doCleanupscCsb g|_|jr/|j ¡\}}}z ||i|¤ŽWnty)|j t ¡¡Ynw|jsdSdSr()ZtearDown_exceptionsr�r5r6r r"r#r¸rrrÚdoClassCleanups}s ÿüzTestCase.doClassCleanupscOs|j|i|¤ŽSr()rû)rr1ÚkwdsrrrÚ__call__‰szTestCase.__call__cCs  t||jƒ}t|jddƒst|ddƒr%t|jddƒp t|ddƒ}t|ƒ‚| ¡| |¡| ¡|jrN|j ¡\}}}|j |g|¢Ri|¤Ž|js5dSdS)NrCFrDrG) rˆr©r¢r rïròrór®r5rô)rr´rùr0r1r2rrrÚdebugŒs   ÿ ÿ þzTestCase.debugcCs t|ƒ‚r(r:)rr=rrrÚskipTest�szTestCase.skipTestcCs | |¡‚r()r^)rr]rrrÚfail¡s z TestCase.failcCs( |r| |dt|ƒ¡}| |¡‚dS)Nz%s is not false©r\rr^©rÚexprr]rrrÚ assertFalse¥ó  þzTestCase.assertFalsecCs( |s| |dt|ƒ¡}| |¡‚dS)Nz%s is not truerrrrrÚ assertTrue«rzTestCase.assertTruecCsR |js|p|S|dur|Szd||fWSty(dt|ƒt|ƒfYSw)Nz%s : %s)Ú longMessageÚUnicodeDecodeErrorr)rr]r_rrrr\±s  ÿzTestCase._formatMessagecOs( t||ƒ}z | d||¡Wd}Sd}w)NÚ assertRaises©rnrm)rÚexpected_exceptionr1r2Úcontextrrrr Æs   zTestCase.assertRaisescOs t||ƒ}| d||¡S)NÚ assertWarns©r�rm)rÚexpected_warningr1r2r rrrrçs zTestCase.assertWarnscCó ddlm}||||dd�S)Nr©Ú_AssertLogsContextF©Zno_logs©Z_logr©rZloggerÚlevelrrrrÚ assertLogss zTestCase.assertLogscCr)NrrTrrrrrrÚ assertNoLogss zTestCase.assertNoLogscCsH t|ƒt|ƒur!|j t|ƒ¡}|dur!t|tƒrt||ƒ}|S|jSr()r@r°Úgetr?r!rˆÚ_baseAssertEqual)rÚfirstÚsecondZasserterrrrÚ_getAssertEqualityFunc's  zTestCase._getAssertEqualityFunccCs2 ||ksdt||ƒ}| ||¡}| |¡‚dS)Nú%s != %s)rr\r^)rrrr]r_rrrrAs   ýzTestCase._baseAssertEqualcCs | ||¡}||||d�dS)N)r])r)rrrr]Zassertion_funcrrrÚ assertEqualHs zTestCase.assertEqualcCs4 ||ks| |dt|ƒt|ƒf¡}| |¡‚dS)Nz%s == %sr)rrrr]rrrÚassertNotEqualOsÿ ýzTestCase.assertNotEqualcCs¸ ||krdS|dur|durtdƒ‚t||ƒ}|dur4||kr#dSdt|ƒt|ƒt|ƒt|ƒf}n|dur:d}t||ƒdkrCdSdt|ƒt|ƒ|t|ƒf}| ||¡}| |¡‚)Nú specify delta or places not bothz(%s != %s within %s delta (%s difference)érz)%s != %s within %r places (%s difference)©rgÚabsrÚroundr\r^©rrrZplacesr]ZdeltaÚdiffr_rrrÚassertAlmostEqualXs6  üü  zTestCase.assertAlmostEqualcCs¶ |dur |dur tdƒ‚t||ƒ}|dur2||ks!||kr!dSdt|ƒt|ƒt|ƒt|ƒf}n|dur8d}||ksEt||ƒdkrEdSdt|ƒt|ƒ|f}| ||¡}| |¡‚)Nr"z(%s == %s within %s delta (%s difference)r#rz%s == %s within %r placesr$r'rrrÚassertNotAlmostEqual…s.  üþ  zTestCase.assertNotAlmostEqualc CsÔ |dur)|j}t||ƒs| d|t|ƒf¡‚t||ƒs(| d|t|ƒf¡‚nd}d}zt|ƒ}WnttfyBd|}Ynw|dur]zt|ƒ}Wnttfy\d|}Ynw|du�r@||krhdSd| ¡ft||ƒ}t t ||ƒƒD]L} z|| } Wntt tfy˜|d| |f7}YnBwz|| } Wntt tfy´|d| |f7}Yn&w| | krÇ|d | ft| | ƒ7}nq{||krÚ|durÚt |ƒt |ƒkrÚdS||k�r |d |||f7}z|d |t||ƒf7}WnHtt tf�y |d ||f7}Yn4w||k�r@|d |||f7}z|d |t||ƒf7}Wntt tf�y?|d||f7}Ynw|} dd  t t |¡ ¡t |¡ ¡¡¡} | | | ¡} | || ¡}| |¡dS)NzFirst sequence is not a %s: %szSecond sequence is not a %s: %sZsequencez(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 r?r^rÚlenrgÚNotImplementedErrorÚ capitalizerÚrangeÚminÚ IndexErrorr@ÚjoinÚdifflibÚndiffÚpprintÚpformatÚ splitlinesÚ_truncateMessager\r)rZseq1Zseq2r]Úseq_typeZ seq_type_nameZ differingZlen1Zlen2ÚiZitem1Zitem2r_ÚdiffMsgrrrÚassertSequenceEqual¨sÄ   ÿ  ÿÿ ÿÿ ÿÿ ÿÿ ÿý ÿýÿý  ÿ ÿ ÿÿ  ÿ ÿ ÿÿ ÿÿ  zTestCase.assertSequenceEqualcCs2|j}|dus t|ƒ|kr||S|tt|ƒSr()ÚmaxDiffr+Ú DIFF_OMITTED)rrŽr(Zmax_diffrrrr7 szTestCase._truncateMessagecCó |j|||td�dS©N)r8)r;r…)rZlist1Zlist2r]rrrr¥s zTestCase.assertListEqualcCr>r?)r;rV)rZtuple1Ztuple2r]rrrr¦szTestCase.assertTupleEqualc Csb z| |¡}Wn1ty!}z | d|¡WYd}~nd}~wty9}z | d|¡WYd}~nd}~wwz| |¡}Wn1tyZ}z | d|¡WYd}~nd}~wtyr}z | d|¡WYd}~nd}~ww|sy|sydSg}|rŽ| d¡|D] }| t|ƒ¡q„|r¡| d¡|D] }| t|ƒ¡q—d |¡} | | || ¡¡dS)Nz/invalid type when attempting set difference: %sz2first 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Ç)Ú differencergrrkr Úreprr1r\) rZset1Zset2r]Z difference1r&Z difference2ÚlinesÚitemr_rrrr§(s@ €€ÿ€€ÿ   zTestCase.assertSetEqualcCs8 ||vrdt|ƒt|ƒf}| | ||¡¡dSdS)Nz%s not found in %s©rrr\©rÚmemberZ containerr]r_rrrÚassertInSóÿýzTestCase.assertIncCs8 ||vrdt|ƒt|ƒf}| | ||¡¡dSdS)Nz%s unexpectedly found in %srDrErrrÚ assertNotInZrHzTestCase.assertNotIncCs8 ||urdt|ƒt|ƒf}| | ||¡¡dSdS)Nz %s is not %srD©rZexpr1Zexpr2r]r_rrrÚassertIsarHzTestCase.assertIscCs2 ||urdt|ƒf}| | ||¡¡dSdS)Nzunexpectedly identical: %srDrJrrrÚ assertIsNothó þzTestCase.assertIsNotc Cs‚| |td¡| |td¡||kr?dt||ƒ}dd t t |¡ ¡t |¡ ¡¡¡}|  ||¡}|  |  ||¡¡dSdS)Nz"First argument is not a dictionaryz#Second argument is not a dictionaryrrÇ) ÚassertIsInstancer²rr1r2r3r4r5r6r7rr\)rZd1Zd2r]r_r(rrrr¤ns   þ úzTestCase.assertDictEqualc CsÔ tjdtdd�g}g}| ¡D]&\}}||vr| |¡q|||kr7| dt|ƒt|ƒt||ƒf¡q|s>|s>dSd}|rNdd dd „|Dƒ¡}|r_|rV|d 7}|d d |¡7}| | ||¡¡dS) Nz&assertDictContainsSubset is deprecatedrÜ)Ú stacklevelz%s, expected: %s, actual: %srGz Missing: %sú,css�|]}t|ƒVqdSr()r)rRr‘rrrrUŽs€z4TestCase.assertDictContainsSubset..z; zMismatched values: %s) r‰rÝÚDeprecationWarningÚitemsr rr1rr\) rZsubsetZ dictionaryr]ZmissingZ mismatchedÚkeyÚvaluer_rrrÚassertDictContainsSubsetzs:þ    ÿÿ€  ÿz!TestCase.assertDictContainsSubsetc Csª t|ƒt|ƒ}}z t |¡}t |¡}Wnty$t||ƒ}Yn w||kr+dSt||ƒ}|rSd}dd„|Dƒ}d |¡} | || ¡}| ||¡}|  |¡dSdS)NzElement counts were not equal: cSsg|]}d|‘qS)z First has %d, Second has %d: %rr)rRr(rrrÚ ²sz-TestCase.assertCountEqual..rÇ) r…Ú collectionsÚCounterrgrrr1r7r\r) rrrr]Z first_seqZ second_seqZ differencesr_rBr:rrrÚassertCountEqual˜s&   þ    úzTestCase.assertCountEqualcCsà | |td¡| |td¡||krnt|ƒ|jks!t|ƒ|jkr(| |||¡|jdd�}|jdd�}t|ƒdkrK| d¡|krK|dg}|dg}dt||ƒ}dd  t   ||¡¡}|  ||¡}|  |  ||¡¡dSdS) NzFirst argument is not a stringzSecond argument is not a stringT)Úkeependsrz rÇrrG)rNr!r+Ú_diffThresholdrr6rÈrr1r2r3r7rr\)rrrr]Z firstlinesZ secondlinesr_r(rrrr¨¸s"     ózTestCase.assertMultiLineEqualcCs8 ||ksdt|ƒt|ƒf}| | ||¡¡dSdS)Nz%s not less than %srD©rÚaÚbr]r_rrrÚ assertLessÌó þzTestCase.assertLesscCs8 ||ksdt|ƒt|ƒf}| | ||¡¡dSdS)Nz%s not less than or equal to %srDr\rrrÚassertLessEqualÒr`zTestCase.assertLessEqualcCs8 ||ksdt|ƒt|ƒf}| | ||¡¡dSdS)Nz%s not greater than %srDr\rrrÚ assertGreaterØr`zTestCase.assertGreatercCs8 ||ksdt|ƒt|ƒf}| | ||¡¡dSdS)Nz"%s not greater than or equal to %srDr\rrrÚassertGreaterEqualÞr`zTestCase.assertGreaterEqualcCs2 |durdt|ƒf}| | ||¡¡dSdS)Nz%s is not NonerD©rr,r]r_rrrÚ assertIsNoneärMzTestCase.assertIsNonecCs( |durd}| | ||¡¡dSdS)Nzunexpectedly None)rr\rdrrrÚassertIsNotNoneês þzTestCase.assertIsNotNonecCs6 t||ƒsdt|ƒ|f}| | ||¡¡dSdS)Nz%s is not an instance of %r©r?rrr\©rr,r r]r_rrrrNðs  þzTestCase.assertIsInstancecCs6 t||ƒrdt|ƒ|f}| | ||¡¡dSdS)Nz%s is an instance of %rrgrhrrrÚassertNotIsInstance÷s  þzTestCase.assertNotIsInstancecOó t|||ƒ}| d||¡S)NÚassertRaisesRegexr )rr rdr1r2r rrrrkýs zTestCase.assertRaisesRegexcOrj)NÚassertWarnsRegexr)rrrdr1r2r rrrrl s zTestCase.assertWarnsRegexcCsL t|ttfƒr t |¡}| |¡s$d|j|f}| ||¡}| |¡‚dS)Nz&Regex didn't match: %r not found in %r) r?r!Úbytesrbrcrvrwr\r^)rÚtextrdr]r_rrrÚ assertRegex s  ÿ  ûzTestCase.assertRegexcCsb t|ttfƒr t |¡}| |¡}|r/d|| ¡| ¡…|j|f}|  ||¡}|  |¡‚dS)Nz"Regex matched: %r matches %r in %r) r?r!rmrbrcrvÚstartÚendrwr\r^)rrnZunexpected_regexr]Úmatchr_rrrÚassertNotRegex,s  ý  ùzTestCase.assertNotRegexcs‡fdd„}|S)Ncs$t d ˆj¡td¡ˆ|i|¤ŽS)NzPlease use {0} instead.rÜ)r‰rÝrrr rQr;©Ú original_funcrrÚdeprecated_func<s  þz,TestCase._deprecate..deprecated_funcr)rurvrrtrÚ _deprecate;s zTestCase._deprecate)r£r()NN©NNN)dr r rÚAssertionErrorr^rr<r[rŸrr±r·r~r¹r»r½rÀrÂrÃrÄrÌrÏrÔrÖrÙrÚràr)r*Ú_subtest_msg_sentinelrærérërírïròrórôrûr÷rürþrÿrrrrr\r rrrrrr r!r)r*r;r7r¥r¦r§rGrIrKrLr¤rUrYr¨r_rarbrcrerfrNrirkrlrorsrwZfailUnlessEqualZ assertEqualsZ failIfEqualZassertNotEqualsZfailUnlessAlmostEqualZassertAlmostEqualsZfailIfAlmostEqualZassertNotAlmostEqualsZ failUnlessZassert_ZfailUnlessRaisesZfailIfZassertRaisesRegexpZassertRegexpMatchesZassertNotRegexpMatchesÚ __classcell__rrr¡rrœ4s            C     !       ÿ- ÿ #c  +                   rœcsheZdZ d‡fdd„ Zdd„Zdd„Zdd „Zd d „Zd d „Zdd„Z dd„Z dd„Z dd„Z ‡Z S)ÚFunctionTestCaseNcs*tt|ƒ ¡||_||_||_||_dSr()ržr|rÚ _setUpFuncÚ _tearDownFuncÚ _testFuncÚ _description)rZtestFuncr»r½Ú descriptionr¡rrrZs  zFunctionTestCase.__init__cCó|jdur | ¡dSdSr()r}rorrrr»aó  ÿzFunctionTestCase.setUpcCr‚r()r~rorrrr½erƒzFunctionTestCase.tearDowncCrîr()rrorrrr£irðzFunctionTestCase.runTestcCs|jjSr()rr rorrrrÏlrÅzFunctionTestCase.idcCs@t||jƒstS|j|jko|j|jko|j|jko|j|jkSr()r?r¢rÑr}r~rr€rÒrrrrÔos   ÿ þ ýzFunctionTestCase.__eq__cCstt|ƒ|j|j|j|jfƒSr()rÕr@r}r~rr€rorrrrÖxsÿzFunctionTestCase.__hash__cCsdt|jƒ|jjfSrØ)rr¢rr rorrrrÙ|s ÿzFunctionTestCase.__str__cCrÍ)Nz <%s tec=%s>)rr¢rrorrrrÚ€s ÿzFunctionTestCase.__repr__cCs2|jdur|jS|jj}|r| d¡d ¡pdSrÆ)r€rr­rÉrÈrÊrrrrÌ„s z!FunctionTestCase.shortDescriptionrx)r r rrr»r½r£rÏrÔrÖrÙrÚrÌr{rrr¡rr|Qs r|csDeZdZ‡fdd„Zdd„Zdd„Zdd„Zd d „Zd d „Z‡Z S) räcs(tƒ ¡||_||_||_|j|_dSr()ržrÚ_messager$râr^)rr$rŽrâr¡rrr�s  z_SubTest.__init__cCstdƒ‚)Nzsubtests cannot be run directly)r,rorrrr£”rÅz_SubTest.runTestcCs^g}|jtur| d |j¡¡|jr(d dd„|j ¡Dƒ¡}| d |¡¡d |¡p.dS)Nz[{}]z, css �|] \}}d ||¡VqdS)z{}={!r}N)rr)rRršr�rrrrUœs € ÿ ÿz+_SubTest._subDescription..z({})ú z ())r„rzr rrrâr1rR)rÚpartsZ params_descrrrÚ_subDescription—s  þz_SubTest._subDescriptioncCsd |j ¡| ¡¡S©Nz{} {})rrr$rÏr‡rorrrrÏ¢sz _SubTest.idcCs |j ¡Sr()r$rÌrorrrrÌ¥s z_SubTest.shortDescriptioncCsd |j| ¡¡Srˆ)rrr$r‡rorrrrÙ«r×z_SubTest.__str__) r r rrr£r‡rÏrÌrÙr{rrr¡rrä‹s  rä)-r"rAr2r4rbr‰rWr)rsrHrGrÚutilrrrrrZ __unittestÚobjectrzr=r6r rrrr-r/r3r9rJrMrOrrQrZrarnr�ÚChainMapr”rœr|rärrrrÚsZ ( *'4 %: