Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/unittest/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/unittest/test/__pycache__/test_case.cpython-39.opt-2.pyc

a

��g# �@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddlZddlmZmZmZmZmZddlmZmZe�d�Ze�d�Ze�d�ZGd	d
�d
e�ZGdd�dejee�Z e!d
kr�e�"�dS)�N)�deepcopy)�support)�TestEquality�TestHashing�
LoggingResult�LegacyLoggingResult�#ResultWithNoStartTestRunStopTestRun)�captured_stderr�
gc_collect�foo�foo.bar�quuxc@s@eZdZGdd�dej�ZGdd�de�ZGdd�dej�ZdS)�Testc@seZdZdd�Zdd�ZdS)zTest.FoocCsdS�N���selfrr�3/usr/local/lib/python3.9/unittest/test/test_case.py�runTest"�zTest.Foo.runTestcCsdSrrrrrr�test1#rzTest.Foo.test1N)�__name__�
__module__�__qualname__rrrrrr�Foo!src@seZdZdd�ZdS)zTest.BarcCsdSrrrrrr�test2&rzTest.Bar.test2N)rrrrrrrr�Bar%srcs4eZdZ�fdd�Zdd�Zdd�Zdd�Z�ZS)	zTest.LoggingTestCasecsttj|��d�||_dS�N�test)�superr�LoggingTestCase�__init__�events)rr"��	__class__rrr!+szTest.LoggingTestCase.__init__cCs|j�d�dS)N�setUp�r"�appendrrrrr%/szTest.LoggingTestCase.setUpcCs|j�d�dSrr&rrrrr2szTest.LoggingTestCase.testcCs|j�d�dS)N�tearDownr&rrrrr(5szTest.LoggingTestCase.tearDown)rrrr!r%rr(�
__classcell__rrr#rr (sr N)rrr�unittest�TestCaserrr rrrrrsrc@s�eZdZe�d�e�d�fgZe�d�e�d�fe�d�e�d�fe�d�e�d�fgZdd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"d:d;�Z#d<d=�Z$d>d?�Z%d@dA�Z&dBdC�Z'dDdE�Z(e)�*e+j,j-dFkdG�dHdI��Z.e)�*e+j,j-dFkdG�dJdK��Z/e)�*e+j,j-dFkdG�dLdM��Z0dNdO�Z1dPdQ�Z2dRdS�Z3dTdU�Z4dVdW�Z5dXdY�Z6dZd[�Z7d\d]�Z8d^d_�Z9d`da�Z:dbdc�Z;ddde�Z<dfdg�Z=dhdi�Z>djdk�Z?dldm�Z@dndo�ZAdpdq�ZBdrds�ZCdtdu�ZDdvdw�ZEdxdy�ZFdzd{�ZGd|d}�ZHd~d�ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYeZj[d�d���Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zbd�d��Zcd�d��Zdd�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d��Zld�dÄZmenjod�dń�Zpd�dDŽZqd�S)��
Test_TestCaserrrcCs�Gdd�dtj�}|�|���dd�d�t��}|�dd�|�|j��|�dd�Wd�n1sn0Y|�t��|��Wd�n1s�0YdS)Nc@seZdZdd�Zdd�ZdS)z3Test_TestCase.test_init__no_test_name.<locals>.TestcSs
t��dSr��MyExceptionrrrrrUrz;Test_TestCase.test_init__no_test_name.<locals>.Test.runTestcSsdSrrrrrrrVrz8Test_TestCase.test_init__no_test_name.<locals>.Test.testN�rrrrrrrrrrTsri�z
.Test.runTest��)r*r+�assertEqual�id�assertRaises�failureException�AttributeError�run)rrrrrr�test_init__no_test_nameSs*z%Test_TestCase.test_init__no_test_namecCs2Gdd�dtj�}|�|d���dd�d�dS)Nc@seZdZdd�Zdd�ZdS)z7Test_TestCase.test_init__test_name__valid.<locals>.TestcSs
t��dSrr-rrrrrjrz?Test_TestCase.test_init__test_name__valid.<locals>.Test.runTestcSsdSrrrrrrrkrz<Test_TestCase.test_init__test_name__valid.<locals>.Test.testNr/rrrrrisrri����z
.Test.test)r*r+r2r3�rrrrr�test_init__test_name__validhsz)Test_TestCase.test_init__test_name__validcCs@Gdd�dtj�}z|d�Wnty0Yn0|�d�dS)Nc@seZdZdd�Zdd�ZdS)z9Test_TestCase.test_init__test_name__invalid.<locals>.TestcSs
t��dSrr-rrrrrurzATest_TestCase.test_init__test_name__invalid.<locals>.Test.runTestcSsdSrrrrrrrvrz>Test_TestCase.test_init__test_name__invalid.<locals>.Test.testNr/rrrrrtsrZtestfoozFailed to raise ValueError)r*r+�
ValueError�failr9rrr�test_init__test_name__invalidssz+Test_TestCase.test_init__test_name__invalidcCs*Gdd�dtj�}|�|d���d�dS)Nc@seZdZdd�ZdS)z.Test_TestCase.test_countTestCases.<locals>.FoocSsdSrrrrrrr�rz3Test_TestCase.test_countTestCases.<locals>.Foo.testN�rrrrrrrrr�srr�)r*r+r2ZcountTestCases�rrrrr�test_countTestCases�sz!Test_TestCase.test_countTestCasescCs2Gdd�dtj�}|���}|�t|�tj�dS)Nc@seZdZdd�ZdS)z1Test_TestCase.test_defaultTestResult.<locals>.FoocSsdSrrrrrrr�sz9Test_TestCase.test_defaultTestResult.<locals>.Foo.runTestN�rrrrrrrrr�sr)r*r+�defaultTestResultr2�type�
TestResult)rr�resultrrr�test_defaultTestResult�s
z$Test_TestCase.test_defaultTestResultcsHg}t|�}G�fdd�dtj���|��|�gd�}|�||�dS)NcseZdZ��fdd�Z�ZS)z>Test_TestCase.test_run_call_order__error_in_setUp.<locals>.Foocst�|���td��dS�Nzraised by Foo.setUp�rr%�RuntimeErrorr�rr$rrr%�szDTest_TestCase.test_run_call_order__error_in_setUp.<locals>.Foo.setUp)rrrr%r)r�rr#rr�sr)�	startTestr%�addError�stopTest�rrr r7r2�rr"rF�expectedrrLr�#test_run_call_order__error_in_setUp�sz1Test_TestCase.test_run_call_order__error_in_setUpcs>g}G�fdd�dtj���|���gd�}|�||�dS)Ncs&eZdZdd�Z��fdd�Z�ZS)zMTest_TestCase.test_run_call_order__error_in_setUp_default_result.<locals>.FoocSs
t|j�Sr�rr"rrrrrC�sz_Test_TestCase.test_run_call_order__error_in_setUp_default_result.<locals>.Foo.defaultTestResultcst�|���td��dSrHrIrrKrrr%�szSTest_TestCase.test_run_call_order__error_in_setUp_default_result.<locals>.Foo.setUp)rrrrCr%r)rrLr#rr�sr)�startTestRunrMr%rNrO�stopTestRun�rr r7r2�rr"rRrrLr�2test_run_call_order__error_in_setUp_default_result�s
z@Test_TestCase.test_run_call_order__error_in_setUp_default_resultcsHg}t|�}G�fdd�dtj��gd�}�|��|�|�||�dS)NcseZdZ��fdd�Z�ZS)z=Test_TestCase.test_run_call_order__error_in_test.<locals>.Foocst�|���td��dS�N�raised by Foo.test�rrrJrrKrrr�szBTest_TestCase.test_run_call_order__error_in_test.<locals>.Foo.test�rrrrr)rrLr#rr�sr�rMr%rr(rNrOrPrQrrLr�"test_run_call_order__error_in_test�sz0Test_TestCase.test_run_call_order__error_in_testcs>g}G�fdd�dtj��gd�}�|���|�||�dS)Ncs&eZdZdd�Z��fdd�Z�ZS)zLTest_TestCase.test_run_call_order__error_in_test_default_result.<locals>.FoocSs
t|j�SrrTrrrrrC�sz^Test_TestCase.test_run_call_order__error_in_test_default_result.<locals>.Foo.defaultTestResultcst�|���td��dSrZr\rrKrrr�szQTest_TestCase.test_run_call_order__error_in_test_default_result.<locals>.Foo.test�rrrrCrr)rrLr#rr�sr�rUrMr%rr(rNrOrVrWrXrrLr�1test_run_call_order__error_in_test_default_result�s
z?Test_TestCase.test_run_call_order__error_in_test_default_resultcsHg}t|�}G�fdd�dtj��gd�}�|��|�|�||�dS)NcseZdZ��fdd�Z�ZS)z?Test_TestCase.test_run_call_order__failure_in_test.<locals>.Foocst�|���|�d�dSrZ�rrr<rrKrrr�szDTest_TestCase.test_run_call_order__failure_in_test.<locals>.Foo.testr]rrLr#rr�sr�rMr%rr(�
addFailurerOrPrQrrLr�$test_run_call_order__failure_in_test�sz2Test_TestCase.test_run_call_order__failure_in_testcs>G�fdd�dtj��gd�}g}�|���|�||�dS)Ncs&eZdZdd�Z��fdd�Z�ZS)zNTest_TestCase.test_run_call_order__failure_in_test_default_result.<locals>.FoocSs
t|j�SrrTrrrrrC�sz`Test_TestCase.test_run_call_order__failure_in_test_default_result.<locals>.Foo.defaultTestResultcst�|���|�d�dSrZrcrrKrrr�szSTest_TestCase.test_run_call_order__failure_in_test_default_result.<locals>.Foo.testr`rrLr#rr�sr)rUrMr%rr(rerOrVrW)rrRr"rrLr�3test_run_call_order__failure_in_test_default_result�s
zATest_TestCase.test_run_call_order__failure_in_test_default_resultcsHg}t|�}G�fdd�dtj���|��|�gd�}|�||�dS)NcseZdZ��fdd�Z�ZS)zATest_TestCase.test_run_call_order__error_in_tearDown.<locals>.Foocst�|���td��dS�Nzraised by Foo.tearDown�rr(rJrrKrrr(szJTest_TestCase.test_run_call_order__error_in_tearDown.<locals>.Foo.tearDown)rrrr(r)rrLr#rrsrr^rPrQrrLr�&test_run_call_order__error_in_tearDownsz4Test_TestCase.test_run_call_order__error_in_tearDowncs>G�fdd�dtj��g}�|���gd�}|�||�dS)Ncs&eZdZdd�Z��fdd�Z�ZS)zPTest_TestCase.test_run_call_order__error_in_tearDown_default_result.<locals>.FoocSs
t|j�SrrTrrrrrCszbTest_TestCase.test_run_call_order__error_in_tearDown_default_result.<locals>.Foo.defaultTestResultcst�|���td��dSrhrirrKrrr(szYTest_TestCase.test_run_call_order__error_in_tearDown_default_result.<locals>.Foo.tearDown)rrrrCr(r)rrLr#rrsrrarWrXrrLr�5test_run_call_order__error_in_tearDown_default_results
zCTest_TestCase.test_run_call_order__error_in_tearDown_default_resultcCs"Gdd�dtj�}|d���dS)Nc@seZdZdd�Zdd�ZdS)z=Test_TestCase.test_run_call_order_default_result.<locals>.FoocSst�Sr)rrrrrrC.szOTest_TestCase.test_run_call_order_default_result.<locals>.Foo.defaultTestResultcSsdSrrrrrrr0szBTest_TestCase.test_run_call_order_default_result.<locals>.Foo.testN)rrrrCrrrrrr-srr)r*r+r7r@rrr�"test_run_call_order_default_result+sz0Test_TestCase.test_run_call_order_default_resultcs4G�fdd�dtj���|��|�|�||�dS)NcseZdZ��fdd�Z�ZS)z6Test_TestCase._check_call_order__subtests.<locals>.Foocs�t�|���dD]�}|j|d��l|dkr6|�d�dD]D}|j|d��$||dkr`td��Wd�q:1st0Yq:Wd�q1s�0Yqdd	dS)
N�r?r1r0��ir?�failure�r1r0��j�r[r)rr�subTestr<rJ�rrorsrKrrr7s
Hz;Test_TestCase._check_call_order__subtests.<locals>.Foo.testr]rrLr#rr6srrW�rrFr"Zexpected_eventsrrLr�_check_call_order__subtests5sz)Test_TestCase._check_call_order__subtestscCs&g}t|�}gd�}|�|||�dS)N)rMr%rr(�addSubTestFailure�addSubTestSuccessryryrzrNrO)rrxrQrrr�test_run_call_order__subtestsMsz+Test_TestCase.test_run_call_order__subtestscCs&g}t|�}gd�}|�|||�dS)Nrd)rrxrQrrr�$test_run_call_order__subtests_legacyVsz2Test_TestCase.test_run_call_order__subtests_legacycs4G�fdd�dtj���|��|�|�||�dS)NcseZdZ��fdd�Z�ZS)z>Test_TestCase._check_call_order__subtests_success.<locals>.Foocs~t�|���dD]f}|j|d��FdD]0}|j|d��Wd�q(1sN0Yq(Wd�q1sn0YqdS)N)r?r1rnrqrr)rrrurvrKrrraszCTest_TestCase._check_call_order__subtests_success.<locals>.Foo.testr]rrLr#rr`srrWrwrrLr�#_check_call_order__subtests_success_s	z1Test_TestCase._check_call_order__subtests_successcCs8g}t|�}gd�ddgddg}|�|||�dS)N)rMr%rr(rtrz�
addSuccessrO)rr}rQrrr�%test_run_call_order__subtests_successls��z3Test_TestCase.test_run_call_order__subtests_successcCs&g}t|�}gd�}|�|||�dS)N)rMr%rr(r~rO)rr}rQrrr�,test_run_call_order__subtests_success_legacyvsz:Test_TestCase.test_run_call_order__subtests_success_legacycsNg}t|�}d|_G�fdd�dtj��gd�}�|��|�|�||�dS)NTcseZdZ��fdd�Z�ZS)zATest_TestCase.test_run_call_order__subtests_failfast.<locals>.Foocs�t�|���|jdd��|�d�Wd�n1s:0Y|jdd��|�d�Wd�n1sp0Y|�d�dS)Nr?rnrpr1)rrrur<rrKrrr�s((zFTest_TestCase.test_run_call_order__subtests_failfast.<locals>.Foo.testr]rrLr#rr�sr)rMr%rr(ryrO)r�failfastrr r7r2rQrrLr�&test_run_call_order__subtests_failfast~s	z4Test_TestCase.test_run_call_order__subtests_failfastcsTg�G�fdd�dtj�}t��}d|_t�|�}|�|�gd�}|��|�dS)Ncs0eZdZ�fdd�Z�fdd�Z�fdd�ZdS)z1Test_TestCase.test_subtests_failfast.<locals>.Foocs@|�����d�Wd�n1s(0Y��d�dS)N�a1�a2)rur'r�r"rr�test_a�s
(z8Test_TestCase.test_subtests_failfast.<locals>.Foo.test_acsr|�����d�Wd�n1s(0Y|���|�d�Wd�n1sZ0Y��d�dS)N�b1rp�b2)rur'r<rr�rr�test_b�s

(
(z8Test_TestCase.test_subtests_failfast.<locals>.Foo.test_bcs��d�dS)N�c�r'rr�rr�test_c�sz8Test_TestCase.test_subtests_failfast.<locals>.Foo.test_cN)rrrr�r�r�rr�rrr�srT)r�r�r�)r*r+rEr�Z	makeSuiter7r2)rrrFZsuiterRrr�r�test_subtests_failfast�s

z$Test_TestCase.test_subtests_failfastcs:g�G�fdd�dtj�}|d���|��ddg�dS)NcseZdZ�fdd�ZdS)z.Test_TestCase.test_subtests_debug.<locals>.Foocs@��d�|�����d�Wd�n1s20YdS)N�	test case�	subtest 1)r'rurr�rrr��s

z5Test_TestCase.test_subtests_debug.<locals>.Foo.test_aN)rrrr�rr�rrr�srr�r�r�)r*r+�debugr2r@rr�r�test_subtests_debug�sz!Test_TestCase.test_subtests_debugcCs(Gdd�dtj�}|�|d�jt�dS)Nc@seZdZdd�ZdS)z9Test_TestCase.test_failureException__default.<locals>.FoocSsdSrrrrrrr�sz>Test_TestCase.test_failureException__default.<locals>.Foo.testNr>rrrrr�srr)r*r+�assertIsr5�AssertionErrorr@rrr�test_failureException__default�sz,Test_TestCase.test_failureException__defaultcCsVg}t|�}Gdd�dtj�}|�|d�jt�|d��|�gd�}|�||�dS)Nc@seZdZdd�ZeZdS)zMTest_TestCase.test_failureException__subclassing__explicit_raise.<locals>.FoocSs
t��dSr)rJrrrrr�szRTest_TestCase.test_failureException__subclassing__explicit_raise.<locals>.Foo.testN�rrrrrJr5rrrrr�srr�rMrerO�rr*r+r�r5rJr7r2�rr"rFrrRrrr�2test_failureException__subclassing__explicit_raise�sz@Test_TestCase.test_failureException__subclassing__explicit_raisecCsVg}t|�}Gdd�dtj�}|�|d�jt�|d��|�gd�}|�||�dS)Nc@seZdZdd�ZeZdS)zMTest_TestCase.test_failureException__subclassing__implicit_raise.<locals>.FoocSs|�d�dS�Nr)r<rrrrr�szRTest_TestCase.test_failureException__subclassing__implicit_raise.<locals>.Foo.testNr�rrrrr�srrr�r�r�rrr�2test_failureException__subclassing__implicit_raise�sz@Test_TestCase.test_failureException__subclassing__implicit_raisecCs Gdd�dtj�}|���dS)Nc@seZdZdd�ZdS)z%Test_TestCase.test_setUp.<locals>.FoocSsdSrrrrrrr�sz-Test_TestCase.test_setUp.<locals>.Foo.runTestNrBrrrrr�sr)r*r+r%r@rrr�
test_setUp�szTest_TestCase.test_setUpcCs Gdd�dtj�}|���dS)Nc@seZdZdd�ZdS)z(Test_TestCase.test_tearDown.<locals>.FoocSsdSrrrrrrrsz0Test_TestCase.test_tearDown.<locals>.Foo.runTestNrBrrrrrsr)r*r+r(r@rrr�
test_tearDown�szTest_TestCase.test_tearDowncCs(Gdd�dtj�}|�|���t�dS)Nc@seZdZdd�ZdS)z"Test_TestCase.test_id.<locals>.FoocSsdSrrrrrrrsz*Test_TestCase.test_id.<locals>.Foo.runTestNrBrrrrrsr)r*r+�assertIsInstancer3�strr@rrr�test_id
szTest_TestCase.test_idcsTg�t���G��fdd�dtj�}|d���}|�|��gd�}|��|�dS)Ncs$eZdZ�fdd�Z�fdd�ZdS)z;Test_TestCase.test_run__uses_defaultTestResult.<locals>.Foocs��d�dSrr�rr�rrrsz@Test_TestCase.test_run__uses_defaultTestResult.<locals>.Foo.testcs�Srrr)�
defaultResultrrrC!szMTest_TestCase.test_run__uses_defaultTestResult.<locals>.Foo.defaultTestResultN)rrrrrCr�r�r"rrrsrr)rUrMrr~rOrV)rr*r+r7r�r2)rrrFrRrr�r� test_run__uses_defaultTestResultsz.Test_TestCase.test_run__uses_defaultTestResultcCs8Gdd�dtj�}t��}|d��|�}|�||�dS)Nc@seZdZdd�ZdS)z9Test_TestCase.test_run__returns_given_result.<locals>.FoocSsdSrrrrrrr1sz>Test_TestCase.test_run__returns_given_result.<locals>.Foo.testNr>rrrrr0srr)r*r+rEr7r�)rrrF�retvalrrr�test_run__returns_given_result.sz,Test_TestCase.test_run__returns_given_resultcsDt���t���G��fdd�dtj�}|d���}|�|��dS)Ncs"eZdZdd�Z��fdd�ZdS)zKTest_TestCase.test_call__invoking_an_instance_delegates_to_run.<locals>.FoocSsdSrrrrrrrAszPTest_TestCase.test_call__invoking_an_instance_delegates_to_run.<locals>.Foo.testcs|�|���Sr)r�)rrF�ZresultInZ	resultOutrrr7DszOTest_TestCase.test_call__invoking_an_instance_delegates_to_run.<locals>.Foo.runN)rrrrr7rr�rrr@srr)r*rEr+r�)rrr�rr�r�0test_call__invoking_an_instance_delegates_to_run<s
z>Test_TestCase.test_call__invoking_an_instance_delegates_to_runcCs|�|���dSr)�assertIsNone�shortDescriptionrrrr�$testShortDescriptionWithoutDocstringMsz2Test_TestCase.testShortDescriptionWithoutDocstringr1z)Docstrings are omitted with -O2 and abovecCs|�|��d�dS)Nz7Tests shortDescription() for a method with a docstring.�r2r�rrrr�(testShortDescriptionWithOneLineDocstringPs�z6Test_TestCase.testShortDescriptionWithOneLineDocstringcCs|�|��d�dS)Nz>Tests shortDescription() for a method with a longer docstring.r�rrrr�*testShortDescriptionWithMultiLineDocstringXs	�z8Test_TestCase.testShortDescriptionWithMultiLineDocstringcCs|�|��d�dS)NzATests shortDescription() whitespace is trimmed, so that the firstr�rrrr�&testShortDescriptionWhitespaceTrimmingfs�z4Test_TestCase.testShortDescriptionWhitespaceTrimmingcsVGdd�dt������}}|�||k�d�fdd�	}|��|�|�||�dS)Nc@seZdZdS)z7Test_TestCase.testAddTypeEqualityFunc.<locals>.SadSnakeN�rrrrrrr�SadSnakersr�cs t|�t|�ko�kSSr)rD)�a�b�msg�r�rr�AllSnakesCreatedEqualvszDTest_TestCase.testAddTypeEqualityFunc.<locals>.AllSnakesCreatedEqual)N)�object�assertFalseZaddTypeEqualityFuncr2)r�s1�s2r�rr�r�testAddTypeEqualityFuncqsz%Test_TestCase.testAddTypeEqualityFunccCs,t�}|�||�|�|j|j|t��dSr)r�r�r4r5�r�thingrrr�testAssertIs~szTest_TestCase.testAssertIscCs,t�}|�|t��|�|j|j||�dSr)r�ZassertIsNotr4r5r�rrr�testAssertIsNot�szTest_TestCase.testAssertIsNotcCs(g}|�|t�|�|j|j|t�dSr)r��listr4r5�dictr�rrr�testAssertIsInstance�s
�z"Test_TestCase.testAssertIsInstancecCs(g}|�|t�|�|j|j|t�dSr)ZassertNotIsInstancer�r4r5r�r�rrr�testAssertNotIsInstance�s
�z%Test_TestCase.testAssertNotIsInstancecCs�dddd�}|�dd�|�dgd��|�d	|�|�d
d�|�dgd��|�d|�|�|j|jd
d�|�|j|jdgd��|�|j|jd|�|�|j|jdd�|�|j|jdgd��|�|j|jd|�dS)NZbananaZgrassZfish)�monkey�cowZsealr��abcr1rmr��drZotter�x�Zelephantr�r?r�)�assertIn�assertNotInr4r5)rZanimalsrrr�testAssertIn�s"��zTest_TestCase.testAssertInc	Cs:t����t�dt�|�ii�|�iddi�|�ddiddi�|�ddiddd��|�ddd�ddd��|�|j�� |�ddii�Wd�n1s�0Y|�|j��$|�ddiddi�Wd�n1s�0Y|�|j��$|�ddiddi�Wd�n1�s*0Y|�|j��&|�ddd�ddi�Wd�n1�sn0Y|�|j��&|�ddd�ddi�Wd�n1�s�0Yd	�d
d�td�D��}|�|j��$|�d
|id
di�Wd�n1�s0YWd�n1�s,0YdS)N�ignorer�r?r1�r�r��oner�)r�r��css|]}t|�VqdSr)�chr)�.0rorrr�	<genexpr>�rz=Test_TestCase.testAssertDictContainsSubset.<locals>.<genexpr>�ru�)	�warnings�catch_warnings�simplefilter�DeprecationWarning�assertDictContainsSubsetr4r5�join�range)rr�rrr�testAssertDictContainsSubset�s(.2466z*Test_TestCase.testAssertDictContainsSubsetc	Cs�diifggft�t�ft�t�fg}|D]�\}}z|�||�Wn&|jyh|�d||f�Yn0z|j||dd�Wn&|jy�|�d||f�Yn0z|�||d�Wq*|jy�|�d||f�Yq*0q*dgfit�ftdd	g�tdd
g�ftddg�td
dg�ftddg�tddg�fg}|D]L\}}|�|j|j||�|�|j|j||d�|j|j|j||dd��q:dS)
N)rrzassertEqual(%r, %r) failedr�r�z$assertEqual(%r, %r) with msg= failedz/assertEqual(%r, %r) with third parameter failedrr�r?r1�r0)�set�	frozensetr2r5r<r4)rZequal_pairsr�r�Z
unequal_pairsrrr�testAssertEqual�sF

�����zTest_TestCase.testAssertEqualcCs|�gg�|�dd�|�gd�ddgg}g}|�tjj|j||�|�tjj|jt|�t|��|�tjj|j|t|��|�|�|�||�|�t|�t|��|�|t|��|�t|�|�|�|j|j|t|��|�|j|jt|�|�|�|j|jd|�|�|j|jdt|��|�|j|jdt|��|�|j|jdd�|�|j|jdd�|�|j|jdd�|�	ii�ddi}i}|�tjj|j	||�|�
|�|�	||�d|d<|�tjj|j	||d�|�|j|j	d|�|�|j|j	g|�|�|j|j	dd�dS)Nrrr�r?r�zThese are unequal)�assertListEqual�assertTupleEqual�assertSequenceEqualr4r*r+r5�tuple�extend�assertDictEqual�update)rr�r�r�r�rrr�testEquality�sh

�
�
�
�����
�


�zTest_TestCase.testEqualityc
Cs�|�|jd�ddd}ddd}d�t�t�|���t�|�����}tj	j
t|�df}t|�d|_z|�||�Wn0|j
y�}z|jd	}WYd}~nd}~00|�d
�|�t|�t|��|�||�t|�d|_z|�||�Wn2|j
�y,}z|jd	}WYd}~nd}~00|�d
�|�t|�t|��|�||�d|_z|�||�Wn2|j
�y�}z|jd	}WYd}~nd}~00|�d
�|�t|�t|��|�||�dS)Ni�r�r�ir��
r?r1rz!assertSequenceEqual did not fail.)r2�maxDiffr��difflibZndiff�pprintZpformat�
splitlinesr*�case�DIFF_OMITTED�lenr�r5�argsr<�
assertLessr��
assertGreaterr�)rZseq1Zseq2�diff�omitted�er�rrr�testAssertSequenceEqualMaxDiff s>� 
 
 
z,Test_TestCase.testAssertSequenceEqualMaxDiffcCsrd|_|�dd�}tjjtd�}|�|d|�d|_|�dd�}|�|d�d|_|�dd�}|�|d�dS)Nr?r�bar�foobarr�)r��_truncateMessager*r�r�r�r2)r�messager�rrr�testTruncateMessageHsz!Test_TestCase.testTruncateMessagec
Csrt�d�}dd�}||_z|�iddi�Wn6|jyb}z|�t|�d�WYd}~nd}~00|�d�dS)Nr2cSsdSr�r�r�r�rrr�truncateXsz<Test_TestCase.testAssertDictEqualTruncates.<locals>.truncater?rrzassertDictEqual did not fail)r*r+r�r�r5r2r�r<�rrr�r�rrr�testAssertDictEqualTruncatesVs
&z*Test_TestCase.testAssertDictEqualTruncatesc
Csnt�d�}dd�}||_z|�dd�Wn6|jy^}z|�t|�d�WYd}~nd}~00|�d�dS)Nr2cSsdSr�rr�rrrr�dszATest_TestCase.testAssertMultiLineEqualTruncates.<locals>.truncaterr�z!assertMultiLineEqual did not fail)r*r+r��assertMultiLineEqualr5r2r�r<r�rrr�!testAssertMultiLineEqualTruncatesbs
&z/Test_TestCase.testAssertMultiLineEqualTruncatescsZ���jd�d�_�j�d�_����fdd��d}���j��$}��|d|d�Wd�n1sn0Y��dt|j����|d|d�d	}d
d�}�j	�|�_	����fdd��|d|d}}���j��}��||�Wd�n1�s0Y��
dt|j����t|j�d
||f���|d|d�dS)Ni� cst�d��S�N�_diffThreshold��setattrr��
old_thresholdrrr�<lambda>wrz=Test_TestCase.testAssertEqual_diffThreshold.<locals>.<lambda>Zxxxxxxxxxxxxxxxxr�r��^Z@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcSstd��dS)Nzthis should not be raised)�SystemError)r�r�rrr�explodingTruncation�szHTest_TestCase.testAssertEqual_diffThreshold.<locals>.explodingTruncationcst�d��S)Nr�rr)�old_truncaterrrr
�rz%r != %r)r2rr��
addCleanupr4r5r�r��	exceptionr�r�)r�s�cmr
r�r�r)r	rrr�testAssertEqual_diffThresholdns*2,z+Test_TestCase.testAssertEqual_diffThresholdcs��j�d�_����fdd��d}|d|d}}���j��}��||�Wd�n1sd0Yd}��t|j�d||f���|d|d�d	}|d||d|}}���j��}��||�Wd�n1s�0Yd
}��t|j�d||||f�d}|d||d|}}���j��}��||�Wd�n1�sf0Yd
}d}��t|j�d||||f�dS)Nrcst�d��Srrrrrrr
�rz7Test_TestCase.testAssertEqual_shorten.<locals>.<lambda>Zdxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxr�r�zKxxxx[35 chars]xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz'%sa' != '%sb'Z2yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyzxxxx[85 chars]xxxxxxxxxxxz'%sa%s' != '%sb%s'Zdyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyzxxxx[91 chars]xxxxxz6yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy[56 chars]yyyy)rrr4r5r2r�r)rrr�r�rr��pr�rrr�testAssertEqual_shorten�s.**,z%Test_TestCase.testAssertEqual_shortencCs�t�}|�gd�gd��|�gd�gd��|�||dddg|dd|df�|�gd�gd��|�|j|jd	dgdgd
d	gd
ddg�|�|j|jgd�gd��|�|j|jdgdd
g�|�|j|jdd
gdg�|�|j|jgd�dd
g�|�d	dgddgdgdddgd	dgg�|�td	dgddg�td	dgddg��|�|j|jgtdd	ddt�g�|�dd	iddigddidd	ig�|�d	dtggtgdd	g�|�|j|jgtgdd	ddt�g�|�|j|jd	ggdgg�|�|j|jgd�dd	g�|�|j|jgd�gd��|�|j|jd	ddiddgddiddg�ddhd	dhg}|ddd�}|�||�ttj	�
dd��}hd�}|�||�tj	�
ggg�}|�|d	dgfg�ttj	�dd��}hd�}|�||�dS)Nrm)r0r1r?)rr��baz)r�rrr1r0)r?�2r�r�)r�rTr�r?�d)r�rTr?�
�)rrrr�rFr�y@y@r�r�)r?r?r1)r?r?rr�r�)rrTr�T���ZaaabccdZabbbcce>)r0r?r�)r?rr�)r?r0r�)rr?r�)
r��assertCountEqualr4r5�iter�divmodr�r�r*�utilZ_count_diff_all_purposer2Z_count_diff_hashable)rr�r�ZdiffsrRrrr�testAssertCountEqual�sn  ��
�
��(��$�����z"Test_TestCase.testAssertCountEqualcCs�t�}t�}|�||�|�|j|jd|�|�|j|jg|�|�|j|j|d�|�|j|j|g�tdg�}t�}|�|j|j||�tdg�}tdg�}|�||�tdg�}tddg�}|�|j|j||�tdg�}tddg�}|�|j|j||�tddg�}tddg�}|�||�t�}d}|�|j|j||�|�|j|j||�tddg�}tdg�}|�|j|j||�dS)Nr�r�r)rr?rq)r�r�)r��assertSetEqualr4r5r�)rZset1Zset2rrr�testAssertSetEqual�s:





z Test_TestCase.testAssertSetEqualcCs|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�|�|j|jdd�dS)	Nr1r?g�������?g�?ZbugZantsbugsant)r�ZassertGreaterEqualr�ZassertLessEqualr4r5rrrr�testInequalitysd�zTest_TestCase.testInequalityc
Csnd}d}d}d|_z|�||�WnF|jyh}z,t|��dd�d}|�||�WYd}~n
d}~00dS)Nzxhttp://www.python.org/doc/2.3/lib/module-unittest.html
test case
    A test case is the smallest unit of testing. [...]
z�http://www.python.org/doc/2.4.1/lib/module-unittest.html
test case
    A test case is the smallest unit of testing. [...] You may provide your
    own implementation that does not subclass from TestCase, of course.
a�- http://www.python.org/doc/2.3/lib/module-unittest.html
?                             ^
+ http://www.python.org/doc/2.4.1/lib/module-unittest.html
?                             ^^^
  test case
-     A test case is the smallest unit of testing. [...]
+     A test case is the smallest unit of testing. [...] You may provide your
?                                                       +++++++++++++++++++++
+     own implementation that does not subclass from TestCase, of course.
r�r?)r�rr5r��splitr2�rZsample_textZrevised_sample_textZsample_text_errorr��errorrrr�testAssertMultiLineEqualOsz&Test_TestCase.testAssertMultiLineEqualc
Cshd}d}d}z|�||�WnF|jyb}z,t|��dd�d}|�||�WYd}~n
d}~00dS)Nzladen swallows fly slowlyzunladen swallows fly quicklyzr- laden swallows fly slowly
?                    ^^^^
+ unladen swallows fly quickly
? ++                   ^^^^^
r�r?)r2r5r�r$r%rrr�testAssertEqualSingleLinensz'Test_TestCase.testAssertEqualSingleLinec	sltjjr�fdd�}ndd�}|��H���j����dd�Wd�n1sT0YWd�n1sr0Y|����dd�Wd�n1s�0Yddg}ddg}|��H���j����||�Wd�n1s�0YWd�n1�s0Y|��R���j��$��t	|�t	|��Wd�n1�s^0YWd�n1�s~0Y|��N���j�� ��
|t	|��Wd�n1�s�0YWd�n1�s�0Y|��N���j�� ��
t	|�|�Wd�n1�s*0YWd�n1�sJ0Y|��J���j����
dd�Wd�n1�s�0YWd�n1�s�0Y|��R���j��$��t|�t|��Wd�n1�s�0YWd�n1�s0Y���j�� ��|t	|��Wd�n1�sT0Y���j�� ��t	|�|�Wd�n1�s�0Yddg}dg}���j����||�Wd�n1�s�0Y���j��$��t	|�t	|��Wd�n1�s0Y���j�� ��
|t	|��Wd�n1�sZ0Y���j�� ��
t	|�|�Wd�n1�s�0Y���j��$��t|�t|��Wd�n1�s�0Ydg}ddg}���j����||�Wd�n1�s"0Y���j��$��t	|�t	|��Wd�n1�sd0Y���j�� ��
|t	|��Wd�n1�s�0Y���j�� ��
t	|�|�Wd�n1�s�0Y���j��$��t|�t|��Wd�n1�s"0Y|��R���j��$��
ddiddi�Wd�n1�sl0YWd�n1�s�0Y���j�� ��
iddi�Wd�n1�s�0Y���j�� ��
ddii�Wd�n1�s0Y���j��$��ddggd��Wd�n1�sJ0Y|��$��ddgddg�Wd�n1�s�0Y|��R���j��$��ddgddg�Wd�n1�s�0YWd�n1�s�0Y|��V���j��(��ddggddgg�Wd�n1�s>0YWd�n1�s^0YdS)Ncs��td�S)Nz#Comparison between bytes and string)�assertWarnsRegex�BytesWarningrrrr�
bytes_warning�s�z=Test_TestCase.testEqualityBytesWarning.<locals>.bytes_warningcSst��Sr)�
contextlib�	ExitStackrrrrr+�sr��ar)r.r.r.)�sys�flagsr+r4r5r2ZassertNotEqualr�r�r�r�r!r�r�r)rr+r�r�rrr�testEqualityBytesWarning~s~H*JTPPLT00,4004,4004T0044Tz&Test_TestCase.testEqualityBytesWarningcCs<|�d�|�|j|jd�|�d�|�|j|jd�dS)NFzDjZoPloGears on Rails)r�r4r5ZassertIsNotNonerrrr�testAssertIsNone�s

zTest_TestCase.testAssertIsNonecCs$|�dd�|�|j|jdd�dS)NZ
asdfabasdfzab+ZsaaasZaaaa)ZassertRegexr4r5rrrr�testAssertRegex�s�zTest_TestCase.testAssertRegexcs�Gdd�dt���fdd�}|��|�|�t�f|�|jttddd�|�|j�� |��dd	��Wd�n1s|0Y|�t��|��d�Wd�n1s�0Y|����|�t|�Wd�n1s�0YdS)
Nc@seZdZdS)z=Test_TestCase.testAssertRaisesCallable.<locals>.ExceptionMockNr�rrrr�
ExceptionMock�sr4cs�d��dS�N�	We expectrr�r4rr�Stub�sz4Test_TestCase.testAssertRaisesCallable.<locals>.Stub�19���basecSsdS�Nrrrrrrr
�rz8Test_TestCase.testAssertRaisesCallable.<locals>.<lambda>)�	Exceptionr4r;�intr5�	TypeError�rr8rr7r�testAssertRaisesCallable�s.*z&Test_TestCase.testAssertRaisesCallablec	s,Gdd�dt���fdd�}|����|�Wd�n1sB0Y|�t�f��}|�Wd�n1sv0Y|�|j��|�|jjdd�|�t��tddd	�Wd�n1s�0Y|�|j��<|����Wd�n1�s0YWd�n1�s(0Y|�	|jd
��@|j�d
d��Wd�n1�sh0YWd�n1�s�0Y|�	t
d
��@|j�dd
��Wd�n1�s�0YWd�n1�s�0Y|����|�t|�Wd�n1�s0YdS)Nc@seZdZdS)z<Test_TestCase.testAssertRaisesContext.<locals>.ExceptionMockNr�rrrrr4�sr4cs�d��dSr5rrr7rrr8�sz3Test_TestCase.testAssertRaisesContext.<locals>.Stubrr6r9r:r;r�r��*�r�)r>r4r;r�rr2r�r?r5�assertRaisesRegexr@)rr8rrr7r�testAssertRaisesContext�s*$$*@@@z%Test_TestCase.testAssertRaisesContextcCs|�t��|��Wd�n1s(0Y|�t��|�d�Wd�n1s\0Y|�t��|�t�Wd�n1s�0Y|�t��|�tdf�Wd�n1s�0Y|�t��|�ttf�Wd�n1�s0YdS�Nr?)r4r@r�r;rrrr�testAssertRaisesNoExceptionType	s&((,z-Test_TestCase.testAssertRaisesNoExceptionTypecCs4dd�}t�|�}|�t|�|�|t�|��dS)NcSs$zt�Wntyt�Yn0dSr)r;rrrr�funcsz4Test_TestCase.testAssertRaisesRefcount.<locals>.func)r/�getrefcountr4r;r2)rrIZrefcountrrr�testAssertRaisesRefcounts
z&Test_TestCase.testAssertRaisesRefcountcszGdd�dt���fdd�}|��t�d�|�|��d|�|�t��|��dd�Wd�n1sl0YdS)Nc@seZdZdS)z:Test_TestCase.testAssertRaisesRegex.<locals>.ExceptionMockNr�rrrrr4#sr4cs�d��dSr5rrr7rrr8&sz1Test_TestCase.testAssertRaisesRegex.<locals>.Stubzexpect$)r>rE�re�compiler4r@rArr7r�testAssertRaisesRegex"sz#Test_TestCase.testAssertRaisesRegexc	Cs�|�|jd|jtt�d�dd��|�|jd|jtddd��|�|jd��@|jtddd��Wd�n1st0YWd�n1s�0Y|�td��@|jtdd	d
��Wd�n1s�0YWd�n1s�0YdS)Nz"^Exception not raised by <lambda>$r�cSsdSrrrrrrr
2rz8Test_TestCase.testAssertNotRaisesRegex.<locals>.<lambda>cSsdSrrrrrrr
6rr��expectr�rCrD)rEr5r>rLrMr@rrrr�testAssertNotRaisesRegex.s ��<z&Test_TestCase.testAssertNotRaisesRegexcCs*Gdd�dt�}|�t|j|dd��dS)Nc@seZdZdS)z>Test_TestCase.testAssertRaisesRegexInvalidRegex.<locals>.MyExcNr�rrrr�MyExcBsrQcSsdS�NTrrrrrr
DrzATest_TestCase.testAssertRaisesRegexInvalidRegex.<locals>.<lambda>)r>r4r@rE)rrQrrr�!testAssertRaisesRegexInvalidRegex@sz/Test_TestCase.testAssertRaisesRegexInvalidRegexcCs*Gdd�dt�}|�t|j|dd��dS)Nc@seZdZdS)z>Test_TestCase.testAssertWarnsRegexInvalidRegex.<locals>.MyWarnNr�rrrr�MyWarnHsrTcSsdSrRrrrrrr
Jrz@Test_TestCase.testAssertWarnsRegexInvalidRegex.<locals>.<lambda>)�Warningr4r@r))rrTrrr� testAssertWarnsRegexInvalidRegexFsz.Test_TestCase.testAssertWarnsRegexInvalidRegexcCs\Gdd�dtj�}|d�tjd<z$|�ttjd�Wtjd=tjd=ntjd=tjd=0dS)Nc@seZdZedd��ZdS)z:Test_TestCase.testAssertWarnsModifySysModules.<locals>.FoocSsdtjd<dS)Nr��@bar@)r/�modulesrrrr�__warningregistry__OszNTest_TestCase.testAssertWarnsModifySysModules.<locals>.Foo.__warningregistry__N)rrr�propertyrYrrrrrNsrrz@foo@rRrW)�types�
ModuleTyper/rX�assertWarns�UserWarningr��warnr@rrr�testAssertWarnsModifySysModulesLs
�z-Test_TestCase.testAssertWarnsModifySysModulesc	CsBdd�}|�|jd|jtd|�|�|jd|jtt�d�|�dS)NcSstd��dS)NZ
Unexpected)r>rrrrr8[sz9Test_TestCase.testAssertRaisesRegexMismatch.<locals>.Stubz*"\^Expected\$" does not match "Unexpected"z
^Expected$)rEr5r>rLrMrArrr�testAssertRaisesRegexMismatchZs�
�z+Test_TestCase.testAssertRaisesRegexMismatchcs~Gdd�dt���fdd�}d}|���}|�||�Wd�n1sL0Y|j}|�|��|�|jd|�dS)Nc@seZdZdS)z=Test_TestCase.testAssertRaisesExcValue.<locals>.ExceptionMockNr�rrrrr4jsr4cs�|��dSrr)rr7rrr8msz4Test_TestCase.testAssertRaisesExcValue.<locals>.Stubzparticular valuer)r>r4rr�r2r�)rr8�v�ctxr�rr7r�testAssertRaisesExcValueis
&z&Test_TestCase.testAssertRaisesExcValuecCsN|�t��|��Wd�n1s(0Y|�t��|�t�Wd�n1s\0Y|�t��|�dd�Wd�n1s�0Y|�t��|�td�Wd�n1s�0Y|�t�� |�tdfd�Wd�n1�s0Y|�t�� |�ttfd�Wd�n1�s@0YdS�Nr?rO)r4r@rEr;r�rrrr�$testAssertRaisesRegexNoExceptionTypexs&(**0z2Test_TestCase.testAssertRaisesRegexNoExceptionTypec	Cs�dd�}|�t|�|�t|�|�ttf|�|jttjdtd�|�|j�� |�tdd��Wd�n1sv0Y|�t��|�td�Wd�n1s�0Yt���Tt�	dt�|�|j��|�t|�Wd�n1s�0YWd�n1�s0Yt���Tt�	dt�|�t��|�t|�Wd�n1�sh0YWd�n1�s�0YdS)	NcSst�dt�dSr��r�r_�RuntimeWarningrrrr�
_runtime_warn�sz<Test_TestCase.testAssertWarnsCallable.<locals>._runtime_warnr��categorycSsdSr=rrrrrr
�rz7Test_TestCase.testAssertWarnsCallable.<locals>.<lambda>�defaultr&)
r]rhr�r�r_r4r5r@r�r��rrirrr�testAssertWarnsCallable�s&�.*
J
z%Test_TestCase.testAssertWarnsCallablec
Csrdd�}t�|�d}|�t��}|�Wd�n1s<0Y|�ttf��}|�Wd�n1sp0Y|�|jt�|�|jjdd�|�	d|j
�|�|j|d�|�t��|�|�Wd�n1s�0Y|�t��tj
dtd�Wd�n1�s"0Y|�|j��<|�t��Wd�n1�s\0YWd�n1�s|0Y|�|jd��@|jtdd	��Wd�n1�s�0YWd�n1�s�0Y|�td��@|jtd
d��Wd�n1�s0YWd�n1�s:0Yt���|t�dt�|�|j��B|�t��|�Wd�n1�s�0YWd�n1�s�0YWd�n1�s�0Yt���zt�d
t�|�t��B|�t��|�Wd�n1�s$0YWd�n1�sD0YWd�n1�sd0YdS)NcSst�dt�dSr�rgrrrrri�sz;Test_TestCase.testAssertWarnsContext.<locals>._runtime_warnr?rr�test_case.pyrjr�r�rCrDrlr&)�inspect�getsourcelinesr]rhr�r��warningr2r�r��filename�linenor�r_r4r5rEr@r�r��rriZ_runtime_warn_linenorrrr�testAssertWarnsContext�sD$$$.@@@
f
z$Test_TestCase.testAssertWarnsContextcCsJ|�t��|��Wd�n1s(0Y|�t��|�d�Wd�n1s\0Y|�t��|�t�Wd�n1s�0Y|�t��|�tdf�Wd�n1s�0Y|�t��|�ttf�Wd�n1�s0Y|�t��|�ttf�Wd�n1�s<0YdSrG)r4r@r]r�r^r>rrrr�testAssertWarnsNoExceptionType�s&((,.z,Test_TestCase.testAssertWarnsNoExceptionTypec	Cs�dd�}|�td|d�|�|j��"|�tddd��Wd�n1sL0Y|�t��|�tdd�Wd�n1s�0Yt���Xt�dt�|�|j�� |�td|d�Wd�n1s�0YWd�n1s�0Y|�|j�� |�td|d�Wd�n1�s20Yt���^t�d	t�|�t|jf�� |�td|d�Wd�n1�s�0YWd�n1�s�0YdS)
NcSst�|t�dSrrgr�rrrri�szATest_TestCase.testAssertWarnsRegexCallable.<locals>._runtime_warn�o+�fooxcSsdSr=rrrrrr
�rz<Test_TestCase.testAssertWarnsRegexCallable.<locals>.<lambda>rl�barzr&)	r)rhr4r5r@r�r�r�r�rmrrr�testAssertWarnsRegexCallable�s4��",
�@�$
�z*Test_TestCase.testAssertWarnsRegexCallablec
CsFdd�}t�|�d}|�td��}|d�Wd�n1s@0Y|�|jt�|�|jjdd�|�d|j	�|�|j
|d�|�|j��<|�td��Wd�n1s�0YWd�n1s�0Y|�
|jd��B|jtddd	��Wd�n1�s0YWd�n1�s<0Y|�
td��B|jtdd
d��Wd�n1�s|0YWd�n1�s�0Yt����t�dt�|�|j��F|�td��|d�Wd�n1�s�0YWd�n1�s0YWd�n1�s60Y|�|j��F|�td��|d
�Wd�n1�sz0YWd�n1�s�0Yt����t�dt�|�t|jf��F|�td��|d
�Wd�n1�s�0YWd�n1�s0YWd�n1�s80YdS)NcSst�|t�dSrrgr�rrrrisz@Test_TestCase.testAssertWarnsRegexContext.<locals>._runtime_warnr?rxryrror�r�rCrDrlrzr&)rprqr)rhr�rrr2r�r�rsrtr4r5rEr@r�r�r�r�rurrr�testAssertWarnsRegexContexts<&<@@
hH
z)Test_TestCase.testAssertWarnsRegexContextcCs�|�t��|��Wd�n1s(0Y|�t��|�t�Wd�n1s\0Y|�t��|�dd�Wd�n1s�0Y|�t��|�td�Wd�n1s�0Y|�t�� |�tdfd�Wd�n1�s0Y|�t�� |�ttfd�Wd�n1�s@0Y|�t�� |�ttfd�Wd�n1�s|0YdSre)r4r@r)r^r�r>rrrr�#testAssertWarnsRegexNoExceptionType.s&(**00z1Test_TestCase.testAssertWarnsRegexNoExceptionTypeccs@t��}dVWd�n1s"0Y|�|��d�dS)Nr�)r	r2�getvalue)r�bufrrr�assertNoStderr>s$zTest_TestCase.assertNoStderrcCs^|�t|�t|��t||�D]:\}}|�|tj�|��D]\}}|�t||�|�q<qdSr)r2r��zipr��logging�	LogRecord�items�getattr)r�records�matchesZrec�match�krbrrr�assertLogRecordsDs
zTest_TestCase.assertLogRecordsc	Cs�|���p|���$}t�d�t�d�Wd�n1s<0Y|�|jdg�|�|j	ddig�Wd�n1s~0YdS)N�1r�
INFO:foo:1�namer)
r��
assertLogs�log_foo�info�
log_foobarr�r2�outputr�r��rrrrr�testAssertLogsDefaultsKs


(z$Test_TestCase.testAssertLogsDefaultsc	Cs�|����|���.}t�d�t�d�t�d�Wd�n1sF0Y|�|j	ddg�|�
|jddiddig�Wd�n1s�0YdS)	Nr�r�3r��WARNING:quux:3r�rr
�r�r�r�r�r�r��log_quuxrrr2r�r�r�r�rrr�!testAssertLogsTwoMatchingMessagesTs



(�z/Test_TestCase.testAssertLogsTwoMatchingMessagesc	Cs�|����|j|d��.}t�d�t�d�t�d�Wd�n1sJ0Y|�|j	ddg�|�
|jddidd	ig�Wd�n1s�0YdS)
N��levelr�rr�zERROR:foo.bar:2zCRITICAL:quux:3r�rr
)r�r�r�rrr�r&r��criticalr2r�r�r�)rr�rrrr�checkAssertLogsPerLevel_s


(�z%Test_TestCase.checkAssertLogsPerLevelcCs|�tj�|�d�dS)N�ERROR)r�r�r�rrrr�testAssertLogsPerLeveljsz$Test_TestCase.testAssertLogsPerLevelc
Cs�|����|jdd���}|j|dd��.}t�d�t�d�t�d�Wd�n1sZ0Y|�|j	ddg�|�
|jdd	idd
ig�Wd�n1s�0Y|�|j	dg�Wd�n1s�0YdS)N�DEBUGr�r�rr�r�zDEBUG:foo.bar:2r�rrr�r�)r�loggerZouter_cmrrrr�checkAssertLogsPerLoggerns


(�"z&Test_TestCase.checkAssertLogsPerLoggercCs|�t�d��|�d�dSr�)r�r��	getLoggerrrrr�testAssertLogsPerLogger|sz%Test_TestCase.testAssertLogsPerLoggerc
Cs�|���d|�|j��8|���Wd�n1s60YWd�n1sT0YWd�n1sr0YdSr)r�r4r5r�rrrr�testAssertLogsFailureNoLogs�s

z)Test_TestCase.testAssertLogsFailureNoLogsc
Cs�|���r|�|j��F|jdd��t�d�Wd�n1sD0YWd�n1sb0YWd�n1s�0YdS)N�WARNINGr�r�)r�r4r5r�r�r�rrrr�!testAssertLogsFailureLevelTooHigh�s
z/Test_TestCase.testAssertLogsFailureLevelTooHighc
Cs�|jddd��p|�|j��D|�d��t�d�Wd�n1sH0YWd�n1sf0YWd�n1s�0YdS)Nr
r�r�rr�)r�r4r5r�r&rrrr�&testAssertLogsFailureMismatchingLogger�sz4Test_TestCase.testAssertLogsFailureMismatchingLoggercCs�|jdf|jdf|jdf|jdf|jdf|jdf|jdf|jdf|jdf|j	df|j
tdd�ff|jdf|j
td	d
d�td	d
dd
�ff|jtddd�ff|jdff}|D]:\}}|�t��||�Wd�q�1s�0Yq�dS)N)r0r��r0r0)�@r�)g@g@)TcSsddS)Ng��Q�	@Zspamr)�_rrrr
�rz9Test_TestCase.testDeprecatedMethodNames.<locals>.<lambda>)Fr?r1r�r0)r�r�r�rcSsidSr�rrrrrr
�r)r�r�)�failIfEqualZassertNotEquals�failUnlessEqualZassertEquals�failUnlessAlmostEqualZassertAlmostEquals�failIfAlmostEqualZassertNotAlmostEquals�
failUnlessZassert_�failUnlessRaisesr@�failIfr�r�ZassertRaisesRegexp�KeyErrorZassertRegexpMatchesr]r�)r�old�methr�rrr�testDeprecatedMethodNames�s&�z'Test_TestCase.testDeprecatedMethodNamesc	Cs`tjdd�dkrdSgd�}|D]8}|�t��t||�Wd�q"1sP0Yq"dS)Nr1r�)r�r�r�r�r�r�r�r�)r/�version_infor4r6r�)rZdeprecated_namesZdeprecated_namerrr�_testDeprecatedFailMethods�sz(Test_TestCase._testDeprecatedFailMethodscCs&Gdd�dtj�}|d�}t|�dS)Nc@seZdZdd�ZdS)z0Test_TestCase.testDeepcopy.<locals>.TestableTestcSsdSrrrrrr�testNothing�sz<Test_TestCase.testDeepcopy.<locals>.TestableTest.testNothingN)rrrr�rrrr�TestableTest�sr�r�)r*r+r)rr�rrrr�testDeepcopy�szTest_TestCase.testDeepcopycCsVt�d�}ttjd�D]8}tj||d�}t�|�}|�||�|�t�t��qdS)Nr7r?)�protocol)	r*r+r��pickle�HIGHEST_PROTOCOL�dumps�loadsr2r�)rrr�Zpickled_testZunpickled_testrrr�
testPickle�s

zTest_TestCase.testPicklec	s�ddd��dd��G�fdd�dtj�}G��fdd�dtj�}G��fd	d
�d
tj�}G�fdd�dtj�}||||fD]:}|�t��|d
���Wd�qz1s�0YqzdS)NcSst�dSr)�KeyboardInterruptrrrr�_raise�sz3Test_TestCase.testKeyboardInterrupt.<locals>._raisecSsdSrrrrrr�nothing�sz4Test_TestCase.testKeyboardInterrupt.<locals>.nothingcseZdZ�ZdS)z2Test_TestCase.testKeyboardInterrupt.<locals>.Test1N�rrr�test_somethingr�r�rr�Test1�sr�cseZdZ�Z�ZdS)z2Test_TestCase.testKeyboardInterrupt.<locals>.Test2N�rrrr%r�r�r�r�rr�Test2�sr�cseZdZ�Z�ZdS)z2Test_TestCase.testKeyboardInterrupt.<locals>.Test3N�rrrr�r(rr�rr�Test3�sr�cseZdZ�fdd�ZdS)z2Test_TestCase.testKeyboardInterrupt.<locals>.Test4cs|���dSr�rrr�rrr��szATest_TestCase.testKeyboardInterrupt.<locals>.Test4.test_somethingNr�rr�rr�Test4�sr�r�)N)r*r+r4r�r7)rr�r�r�r��klassrr�r�testKeyboardInterrupt�s
z#Test_TestCase.testKeyboardInterruptcs�ddd��dd��G�fdd�dtj�}G��fdd�dtj�}G��fd	d
�d
tj�}G�fdd�dtj�}||||fD]:}t��}|d
��|�|�t|j�d�|�|jd�qzdS)NcSst�d��dS)Nzsome reason)r*ZSkipTestrrrr�_skip�sz3Test_TestCase.testSkippingEverywhere.<locals>._skipcSsdSrrrrrrr��sz5Test_TestCase.testSkippingEverywhere.<locals>.nothingcseZdZ�ZdS)z3Test_TestCase.testSkippingEverywhere.<locals>.Test1Nr�r�r�rrr��sr�cseZdZ�Z�ZdS)z3Test_TestCase.testSkippingEverywhere.<locals>.Test2Nr�r�r�r�rrr��sr�cseZdZ�Z�ZdS)z3Test_TestCase.testSkippingEverywhere.<locals>.Test3Nr�rr�rrr�sr�cseZdZ�fdd�ZdS)z3Test_TestCase.testSkippingEverywhere.<locals>.Test4cs|���dSrr�rr�rrr�szBTest_TestCase.testSkippingEverywhere.<locals>.Test4.test_somethingNr�rr�rrr�sr�r�r?)N)r*r+rEr7r2r�Zskipped�testsRun�rr�r�r�r�r�rFrr�r�testSkippingEverywhere�s
z$Test_TestCase.testSkippingEverywherecs�ddd��dd��G�fdd�dtj�}G��fdd�dtj�}G��fd	d
�d
tj�}G�fdd�dtj�}||||fD]:}t��}|d
��|�|�t|j�d�|�|jd�qzdS)NcSst�dSr)�
SystemExitrrrrr�sz,Test_TestCase.testSystemExit.<locals>._raisecSsdSrrrrrrr�sz-Test_TestCase.testSystemExit.<locals>.nothingcseZdZ�ZdS)z+Test_TestCase.testSystemExit.<locals>.Test1Nr�rr�rrr�sr�cseZdZ�Z�ZdS)z+Test_TestCase.testSystemExit.<locals>.Test2Nr�rr�rrr�sr�cseZdZ�Z�ZdS)z+Test_TestCase.testSystemExit.<locals>.Test3Nr�rr�rrr�sr�cseZdZ�fdd�ZdS)z+Test_TestCase.testSystemExit.<locals>.Test4cs|���dSrr�rr�rrr� sz:Test_TestCase.testSystemExit.<locals>.Test4.test_somethingNr�rr�rrr�sr�r�r?)N)r*r+rEr7r2r��errorsr�r�rr�r�testSystemExits
zTest_TestCase.testSystemExitcCsLt��}t�|�}t���~|�|��Wd�n1s>0YdSr)r*r+�weakref�refrZ
disable_gcr�)rr��wrrrr�testNoCycles)s


zTest_TestCase.testNoCyclescs\G�fdd�dt��G�fdd�dtj�}dD](}||�}|��t�|��jd�q.dS)Ncs(eZdZdZ�fdd�Z�fdd�ZdS)z9Test_TestCase.test_no_exception_leak.<locals>.MyExceptionrcs�jd7_t�|�dSrG)�	ninstancer>r!rr-rrr!7szBTest_TestCase.test_no_exception_leak.<locals>.MyException.__init__cs�jd8_dSrG)r�rr-rr�__del__;szATest_TestCase.test_no_exception_leak.<locals>.MyException.__del__N)rrrr�r!r�rr-rrr.4sr.cs*eZdZ�fdd�Zej�fdd��ZdS)z6Test_TestCase.test_no_exception_leak.<locals>.TestCasecs
���dSrrrr-rrr?sz<Test_TestCase.test_no_exception_leak.<locals>.TestCase.test1cs
���dSrrrr-rrrBsz<Test_TestCase.test_no_exception_leak.<locals>.TestCase.test2N)rrrrr*ZexpectedFailurerrr-rrr+>sr+)rrr)r>r*r+r7r
r2r�)rr+Zmethod_nameZtestcaserr-r�test_no_exception_leak1s
z$Test_TestCase.test_no_exception_leakN)rrrrrrZeq_pairsrZne_pairsr8r:r=rArGrSrYr_rbrfrgrjrkrlrxr{r|r}rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r*ZskipIfr/r0�optimizer�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr r"r#r'r(r1r2r3rBrFrHrKrNrPrSrVr`rardrfrnrvrwr{r|r}r,�contextmanagerr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rZcpython_onlyr�r�rrrrr,9s��

		


	�
�
�
	
%4($>(:L 
0!,
	

r,�__main__)#r,r�r�r�rLr/r�r�r�rpr[�copyrrrr*Zunittest.test.supportrrrrrZtest.supportr	r
r�r�r�r�r�rr+r,r�mainrrrr�<module>sH


"

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists