HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/unittest/test/__pycache__/test_assertions.cpython-37.opt-2.pyc
B

"��g�B�@sdddlZddlZddlZddlZddlmZGdd�dej�ZGdd�dej�Ze	dkr`e�
�dS)�N)�productc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�Test_AssertionscCs�|�dd�|�dd�|�|j|jdd�|�|j|jdd�|jdddd�|j|j|jdddd�|jdddd�|jdddd�|j|j|jdddd�|j|j|jdddd�|�td	�td	��|�|j|jtd	�td	��dS)
Ng�1��?g�?g����?g�������?r)�places�y�������?�������?�inf)�assertAlmostEqual�assertNotAlmostEqual�assertRaises�failureException�float)�self�r
�9/usr/local/lib/python3.7/unittest/test/test_assertions.py�test_AlmostEqual	s$z Test_Assertions.test_AlmostEqualcCs|jdddd�|jdddd�|jdddd�|jdddd�|jdddd�|j|j|jdddd�|j|j|jdddd�|j|j|jdddd�|jt|jddddd�|jt|jddddd�tj��}|tjdd	�}|j||tjd
d	�d�|j||tjdd	�d�dS)Ng�������?g�?g�?)�deltag�������?�)rr�
)Zseconds��)rrr	r
�	TypeError�datetimeZnowZ	timedelta)r�first�secondr
r
r�test_AmostEqualWithDelta s*


z(Test_Assertions.test_AmostEqualWithDeltacCs�dd�}|�t|t�|�t|td��y|�tdd��Wn4|jk
rp}z|�dt|��Wdd}~XYnX|�d�y|�t|t�Wntk
r�YnX|�d�|�t��8}yt�Wn(tk
r�}z
|}�Wdd}~XYnXWdQRX|�|j	|�|�t��td��WdQRXy|�t��WdQRXWn6|jk
�rr}z|�dt|��Wdd}~XYnX|�d�y|�t��
t�WdQRXWntk
�r�YnX|�d�dS)	NcSs|�dS)Nr
)�er
r
r�_raise<sz1Test_Assertions.test_assertRaises.<locals>._raise�keycSsdS)Nr
r
r
r
r�<lambda>A�z3Test_Assertions.test_assertRaises.<locals>.<lambda>zKeyError not raisedzassertRaises() didn't failz0assertRaises() didn't let exception pass through)
r	�KeyErrorr
�assertIn�str�fail�
ValueError�	Exception�assertIsZ	exception)rrr�cm�excr
r
r�test_assertRaises;sD"

"
z!Test_Assertions.test_assertRaisescs^Gdd�d��d�G��fdd�dtj�}|d���|����|d���|����dS)Nc@seZdZdS)z<Test_Assertions.test_assertRaises_frames_survival.<locals>.AN)�__name__�
__module__�__qualname__r
r
r
r�Ahsr,cs*eZdZ��fdd�Zdd�Zdd�ZdS)z>Test_Assertions.test_assertRaises_frames_survival.<locals>.Foocs6��}t�|��yt�Wntk
r0t�YnXdS)N)�weakref�ref�OSErrorr#)r�a)r,�wrr
r�foons
zBTest_Assertions.test_assertRaises_frames_survival.<locals>.Foo.foocSs|�t|j�dS)N)r	r#r2)rr
r
r�test_functionalwszNTest_Assertions.test_assertRaises_frames_survival.<locals>.Foo.test_functionalc	Ss"|�t��|��WdQRXdS)N)r	r#r2)rr
r
r�	test_withzszHTest_Assertions.test_assertRaises_frames_survival.<locals>.Foo.test_withN)r)r*r+r2r3r4r
)r,r1r
r�Fools	r5r3r4)�unittest�TestCase�run�assertIsNone)rr5r
)r,r1r�!test_assertRaises_frames_survivalesz1Test_Assertions.test_assertRaises_frames_survivalc
Csd|�dd�y|�ddd�Wn6|jk
rT}z|�d|jd�Wdd}~XYnX|�d�dS)NzAla ma kotazr+zk.tZMessagerz"assertNotRegex should have failed.)�assertNotRegexr
r �argsr")rrr
r
r�testAssertNotRegex�s$z"Test_Assertions.testAssertNotRegexN)r)r*r+rrr(r:r=r
r
r
rrs
*rc@seZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCS)D�TestLongMessagecsDG�fdd�dtj�}G�fdd�dtj�}|d��_|d��_dS)NcseZdZdZ�jZdd�ZdS)z0TestLongMessage.setUp.<locals>.TestableTestFalseFcSsdS)Nr
)rr
r
r�testTest�sz9TestLongMessage.setUp.<locals>.TestableTestFalse.testTestN)r)r*r+�longMessager
r?r
)rr
r�TestableTestFalse�srAcseZdZdZ�jZdd�ZdS)z/TestLongMessage.setUp.<locals>.TestableTestTrueTcSsdS)Nr
)rr
r
rr?�sz8TestLongMessage.setUp.<locals>.TestableTestTrue.testTestN)r)r*r+r@r
r?r
)rr
r�TestableTestTrue�srBr?)r6r7�testableTrue�
testableFalse)rrArBr
)rr�setUp�s
zTestLongMessage.setUpcCs|�tjj�dS)N)�
assertTruer6r7r@)rr
r
r�testDefault�szTestLongMessage.testDefaultcCsl|�|j�dd�d�|�|j�dd�d�|�|j�dd�d�|�|j�dd�d�|j�t�d�dS)Nr2�barz	bar : foo)ZassertEqualrD�_formatMessagerC�object)rr
r
r�test_formatMsg�s
zTestLongMessage.test_formatMsgcCs*d�dd�td�D��}|j�|d�dS)N�css|]}t|�VqdS)N)�chr)�.0�ir
r
r�	<genexpr>�szCTestLongMessage.test_formatMessage_unicode_error.<locals>.<genexpr>�u�)�join�rangerCrI)rZoner
r
r� test_formatMessage_unicode_error�sz0TestLongMessage.test_formatMessage_unicode_errorc

sn��fdd�}xZt|�D]N\}}||�}i}|d}	|	r@ddi}�j�j|d��|||�WdQRXqWdS)Ncs$|dk}|r�j}n�j}t|��S)Nr)rDrC�getattr)rOZuseTestableFalseZtest)�
methodNamerr
r�	getMethod�s
z1TestLongMessage.assertMessages.<locals>.getMethodr�msg�oops)�expected_regex)�	enumerate�assertRaisesRegexr
)
rrVr<�errorsrWrOrZZ
testMethod�kwargsZwithMsgr
)rVrr�assertMessages�s	
zTestLongMessage.assertMessagescCs|�ddddddg�dS)NrF)Fz^False is not true$z^oops$z^False is not true : oops$)r_)rr
r
r�testAssertTrue�szTestLongMessage.testAssertTruecCs|�ddddddg�dS)NZassertFalse)Tz^True is not false$z^oops$z^True is not false : oops$)r_)rr
r
r�testAssertFalse�szTestLongMessage.testAssertFalsecCs|�ddddddg�dS)NZassertNotEqual)rrz^1 == 1$z^oops$z^1 == 1 : oops$)r_)rr
r
r�testNotEqual�szTestLongMessage.testNotEqualcCs|�ddddddg�dS)Nr)rrz)^1 != 2 within 7 places \(1 difference\)$z^oops$z0^1 != 2 within 7 places \(1 difference\) : oops$)r_)rr
r
r�testAlmostEqual�s
zTestLongMessage.testAlmostEqualcCs|�ddddddg�dS)Nr)rrz^1 == 1 within 7 places$z^oops$z^1 == 1 within 7 places : oops$)r_)rr
r
r�testNotAlmostEqual�sz"TestLongMessage.testNotAlmostEqualcCs|�ddddddg�dS)NZ_baseAssertEqual)rrz^1 != 2$z^oops$z^1 != 2 : oops$)r_)rr
r
r�test_baseAssertEqual�sz$TestLongMessage.test_baseAssertEqualcCs |�dgdgfddddg�dS)NZassertSequenceEqualz\+ \[None\]$z^oops$z\+ \[None\] : oops$)r_)rr
r
r�testAssertSequenceEqual�sz'TestLongMessage.testAssertSequenceEqualcCs&|�dt�tdg�fddddg�dS)NZassertSetEqualzNone$z^oops$zNone : oops$)r_�set)rr
r
r�testAssertSetEqual�sz"TestLongMessage.testAssertSetEqualcCs|�ddgfddddg�dS)Nr z^None not found in \[\]$z^oops$z^None not found in \[\] : oops$)r_)rr
r
r�testAssertIn�szTestLongMessage.testAssertIncCs |�dddgfddddg�dS)NZassertNotInz%^None unexpectedly found in \[None\]$z^oops$z,^None unexpectedly found in \[None\] : oops$)r_)rr
r
r�testAssertNotInszTestLongMessage.testAssertNotIncCs"|�diddifddddg�dS)NZassertDictEqualr�valuez\+ \{'key': 'value'\}$z^oops$z\+ \{'key': 'value'\} : oops$)r_)rr
r
r�testAssertDictEqual	sz#TestLongMessage.testAssertDictEqualc	CsBt���0t�dt�|�dddiifddddg�WdQRXdS)N�ignoreZassertDictContainsSubsetrrkz^Missing: 'key'$z^oops$z^Missing: 'key' : oops$)�warnings�catch_warnings�simplefilter�DeprecationWarningr_)rr
r
r�testAssertDictContainsSubsets
z,TestLongMessage.testAssertDictContainsSubsetcCs|�ddddddg�dS)NZassertMultiLineEqual)rLr2z\+ foo$z^oops$z\+ foo : oops$)r_)rr
r
r�testAssertMultiLineEqualsz(TestLongMessage.testAssertMultiLineEqualcCs|�ddddddg�dS)NZ
assertLess)rrz^2 not less than 1$z^oops$z^2 not less than 1 : oops$)r_)rr
r
r�testAssertLessszTestLongMessage.testAssertLesscCs|�ddddddg�dS)NZassertLessEqual)rrz^2 not less than or equal to 1$z^oops$z&^2 not less than or equal to 1 : oops$)r_)rr
r
r�testAssertLessEqual#sz#TestLongMessage.testAssertLessEqualcCs|�ddddddg�dS)NZ
assertGreater)rrz^1 not greater than 2$z^oops$z^1 not greater than 2 : oops$)r_)rr
r
r�testAssertGreater)sz!TestLongMessage.testAssertGreatercCs|�ddddddg�dS)NZassertGreaterEqual)rrz"^1 not greater than or equal to 2$z^oops$z)^1 not greater than or equal to 2 : oops$)r_)rr
r
r�testAssertGreaterEqual/sz&TestLongMessage.testAssertGreaterEqualcCs|�ddddddg�dS)Nr9)znot Nonez^'not None' is not None$z^oops$z^'not None' is not None : oops$)r_)rr
r
r�testAssertIsNone5sz TestLongMessage.testAssertIsNonecCs|�ddddddg�dS)NZassertIsNotNone)Nz^unexpectedly None$z^oops$z^unexpectedly None : oops$)r_)rr
r
r�testAssertIsNotNone;sz#TestLongMessage.testAssertIsNotNonecCs|�ddddddg�dS)Nr%)Nr2z^None is not 'foo'$z^oops$z^None is not 'foo' : oops$)r_)rr
r
r�testAssertIsAszTestLongMessage.testAssertIscCs|�ddddddg�dS)NZassertIsNot)NNz^unexpectedly identical: None$z^oops$z%^unexpectedly identical: None : oops$)r_)rr
r
r�testAssertIsNotGszTestLongMessage.testAssertIsNotcCs|�ddddddg�dS)NZassertRegex)r2rHz^Regex didn't match:z^oops$z!^Regex didn't match: (.*) : oops$)r_)rr
r
r�testAssertRegexMs
zTestLongMessage.testAssertRegexcCs|�ddddddg�dS)Nr;)r2r2z^Regex matched:z^oops$z^Regex matched: (.*) : oops$)r_)rr
r
rr=Ts
z"TestLongMessage.testAssertNotRegexcCszt|j|jfiddif�}xZt||�D]L\\}}}t||�}	|�|j|��"|	||��}
|�WdQRXWdQRXq&WdS)NrXrY)rrDrC�ziprUr\r
)rrVr<�funcr]�p�clsr^�err�methodr&r
r
r�assertMessagesCM\s
z TestLongMessage.assertMessagesCMc	Cs"|�dtfdd�ddddg�dS)Nr	cSsdS)Nr
r
r
r
rrprz2TestLongMessage.testAssertRaises.<locals>.<lambda>z^TypeError not raised$z^oops$z^TypeError not raised : oops$)r�r)rr
r
r�testAssertRaisesosz TestLongMessage.testAssertRaisesc	CsH|�dtdfdd�ddddg�dd	�}|�dtd
f|ddddg�dS)
Nr\zunused regexcSsdS)Nr
r
r
r
rrxrz7TestLongMessage.testAssertRaisesRegex.<locals>.<lambda>z^TypeError not raised$z^oops$z^TypeError not raised : oops$cSstd��dS)Nr2)rr
r
r
r�raise_wrong_message}szBTestLongMessage.testAssertRaisesRegex.<locals>.raise_wrong_message�regexz^"regex" does not match "foo"$z%^"regex" does not match "foo" : oops$)r�r)rr�r
r
r�testAssertRaisesRegexusz%TestLongMessage.testAssertRaisesRegexc	Cs"|�dtfdd�ddddg�dS)NZassertWarnscSsdS)Nr
r
r
r
rr�rz1TestLongMessage.testAssertWarns.<locals>.<lambda>z^UserWarning not triggered$z^oops$z"^UserWarning not triggered : oops$)r��UserWarning)rr
r
r�testAssertWarns�szTestLongMessage.testAssertWarnsc	CsH|�dtdfdd�ddddg�dd	�}|�dtd
f|ddddg�dS)
NZassertWarnsRegexzunused regexcSsdS)Nr
r
r
r
rr�rz6TestLongMessage.testAssertWarnsRegex.<locals>.<lambda>z^UserWarning not triggered$z^oops$z"^UserWarning not triggered : oops$cSst�d�dS)Nr2)rn�warnr
r
r
rr��szATestLongMessage.testAssertWarnsRegex.<locals>.raise_wrong_messager�z^"regex" does not match "foo"$z%^"regex" does not match "foo" : oops$)r�r�)rr�r
r
r�testAssertWarnsRegex�sz$TestLongMessage.testAssertWarnsRegexN)$r)r*r+rErGrKrTr_r`rarbrcrdrerfrhrirjrlrrrsrtrurvrwrxryrzr{r|r=r�r�r�r�r�r
r
r
rr>�sB
	r>�__main__)rrnr-r6�	itertoolsrr7rr>r)�mainr
r
r
r�<module>s