Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.11/unittest/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.11/unittest/test/__pycache__/test_assertions.cpython-311.opt-1.pyc

�

TԚg8C���ddlZddlZddlZddlZddlmZddlmZGd�dej��Z	Gd�dej��Z
edkrej��dSdS)	�N)�
gc_collect)�productc�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)�Test_Assertionsc�&�|�dd��|�dd��|�|j|jdd��|�|j|jdd��|�ddd���|�|j|jddd���|�ddd���|�ddd���|�|j|jddd���|�|j|jddd���|�t	d	��t	d	����|�|j|jt	d	��t	d	����dS)
Ng�1��?��?g����?皙�����?r)�places�y�������?�������?�inf)�assertAlmostEqual�assertNotAlmostEqual�assertRaises�failureException�float��selfs �:/usr/local/lib/python3.11/unittest/test/test_assertions.py�test_AlmostEqualz Test_Assertions.test_AlmostEqual
s������z�3�/�/�/��!�!�)�S�1�1�1����$�/��0�)�S�	B�	B�	B����$�/��3�Z��	F�	F�	F�	
���s�C���2�2�2����$�/��0�#�s�1�	�	F�	F�	F�	
���q�&���3�3�3��!�!�!�V�A�!�6�6�6����$�/��0�!�V�A�	�	G�	G�	G����$�/��3�Q��q�	�	J�	J�	J�	
���u�U�|�|�U�5�\�\�:�:�:����$�/��1J���,�,��e���	6�	6�	6�	6�	6�c�z�|�ddd���|�ddd���|�ddd���|�ddd���|�ddd���|�|j|jddd���|�|j|jddd���|�|j|jddd���|�t|jdddd���|�t|jdddd���t
j���}|tjd�	��z}|�||tjd
�	�����|�||tjd�	�����dS)Nr	rg�?)�deltag�������?�)r
r�
)�seconds��)r
rrr�	TypeError�datetime�now�	timedelta)r�first�seconds   r�test_AmostEqualWithDeltaz(Test_Assertions.test_AmostEqualWithDelta!s�����s�C�s��3�3�3����s�C�s��3�3�3��!�!�#�s�$�!�7�7�7��!�!�#�s�$�!�7�7�7����s�C�s��3�3�3����$�/��1J��s�#�	�	/�	/�	/�	
���$�/��1G��s�$�	�	0�	0�	0����$�/��1J��s�#�	�	/�	/�	/�	
���)�T�%;��s�1�A�	�	7�	7�	7����)�T�%>��s�1�A�	�	7�	7�	7��!�%�%�'�'����+�B�7�7�7�7�����u�f�%-�%7��%C�%C�%C�	�	E�	E�	E��!�!�%��(0�(:�1�(E�(E�(E�	"�	G�	G�	G�	G�	Grc���d�}|�t|t��|�t|td����	|�td���|�d��n:#|j$r-}|�dt|����Yd}~nd}~wwxYw	|�t|t��|�d��n#t$rYnwxYw|�t��5}	t�#t$r}|}�d}~wwxYw#1swxYwY|�|j	|��|�t��5td���#1swxYwY	|�t��5	ddd��n#1swxYwY|�d��n:#|j$r-}|�dt|����Yd}~nd}~wwxYw	|�t��5t�#1swxYwY	|�d��dS#t$rYdSwxYw)Nc��|��N�)�es r�_raisez1Test_Assertions.test_assertRaises.<locals>._raise=s���Gr�keyc��dSr'r(r(rr�<lambda>z3Test_Assertions.test_assertRaises.<locals>.<lambda>Bs���rzassertRaises() didn't failzKeyError not raisedz0assertRaises() didn't let exception pass through)
r�KeyError�failr�assertIn�str�
ValueError�	Exception�assertIs�	exception)rr*r)�cm�excs     r�test_assertRaisesz!Test_Assertions.test_assertRaises<so��	�	�	����(�F�H�5�5�5����(�F�H�U�O�O�<�<�<�	4����h���5�5�5�
�I�I�2�3�3�3�3���$�	9�	9�	9��M�M�/��Q���8�8�8�8�8�8�8�8�����	9����	J����h��
�;�;�;�
�I�I�H�I�I�I�I���	�	�	��D�	�����
�
�x�
(�
(�	�B�
�����
�
�
��������
����	�	�	�	����	�	�	�	�	
�
�
�b�l�C�(�(�(�
�
�
�x�
(�
(�	"�	"��5�/�/�!�	"�	"�	"�	"����	"�	"�	"�	"�	4��"�"�8�,�,�
�
��
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�

�I�I�2�3�3�3�3���$�	9�	9�	9��M�M�/��Q���8�8�8�8�8�8�8�8�����	9����	J��"�"�8�,�,�
!�
!� � �
!�
!�
!�
!����
!�
!�
!�
!�
!�

�I�I�H�I�I�I�I�I���	�	�	��D�D�	���s��B�
B8�#B3�3B8�<!C3�3
D�?D�D;�D&�&
D8�0D3�3D8�8D;�;D?�D?�;F�F�F�G �1F?�3G �?G�G �G�G � 
H�*#H�H�I �5H=�=I�I �I�I � 
I.�-I.c�~���Gd�d���d�G��fd�dtj��}|d�����t��|������|d�����t��|������dS)Nc��eZdZdS)�<Test_Assertions.test_assertRaises_frames_survival.<locals>.AN)�__name__�
__module__�__qualname__r(rr�Ar;is�������Drr?c�(��eZdZ��fd�Zd�Zd�ZdS)�>Test_Assertions.test_assertRaises_frames_survival.<locals>.Fooc�z�����}tj|���	t�#t$rt�wxYwr')�weakref�ref�OSErrorr2)r�ar?�wrs  ��r�foozBTest_Assertions.test_assertRaises_frames_survival.<locals>.Foo.fooosF����A�C�C���[��^�^��%�!�M���%�%�%�$�$�%���s�(�:c�F�|�t|j��dSr'�rr2rHrs r�test_functionalzNTest_Assertions.test_assertRaises_frames_survival.<locals>.Foo.test_functionalxs ���!�!�*�d�h�7�7�7�7�7rc��|�t��5|���ddd��dS#1swxYwYdSr'rJrs r�	test_withzHTest_Assertions.test_assertRaises_frames_survival.<locals>.Foo.test_with{s����&�&�z�2�2����H�H�J�J�J���������������������s�=�A�AN)r<r=r>rHrKrM)r?rGs��r�FoorAmsQ�������
%�
%�
%�
%�
%�
%�
8�
8�
8�
�
�
�
�
rrNrKrM)�unittest�TestCase�runr�assertIsNone)rrNr?rGs  @@r�!test_assertRaises_frames_survivalz1Test_Assertions.test_assertRaises_frames_survivalfs�����	�	�	�	�	�	�	�	�
��	�	�	�	�	�	�	�	�(�#�	�	�	�$	�����"�"�$�$�$��������"�"�$�$������K���������������"�"�$�$�����rc��|�dd��	|�ddd��|�d��dS#|j$r,}|�d|jd��Yd}~dSd}~wwxYw)NzAla ma kotazr+zk.t�Messagez"assertNotRegex should have failed.r)�assertNotRegexr/rr0�args)rr)s  r�testAssertNotRegexz"Test_Assertions.testAssertNotRegex�s������M�5�1�1�1�	<����
�v�y�A�A�A�
�I�I�:�;�;�;�;�;���$�	0�	0�	0��M�M�)�Q�V�A�Y�/�/�/�/�/�/�/�/�/�����	0���s�A�
A<�!A7�7A<N)r<r=r>rr$r8rSrXr(rrrr	sg������6�6�6�.G�G�G�6(J�(J�(J�T � � �@<�<�<�<�<rrc���eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#S)$�TestLongMessagez�Test that the individual asserts honour longMessage.
    This actually tests all the message behaviour for
    asserts that use longMessage.c���G�fd�dtj��}G�fd�dtj��}|d���_|d���_dS)Nc�(��eZdZdZ�jZd�ZdS)�0TestLongMessage.setUp.<locals>.TestableTestFalseFc��dSr'r(rs r�testTestz9TestLongMessage.setUp.<locals>.TestableTestFalse.testTest�����rN�r<r=r>�longMessagerr_rs�r�TestableTestFalser]�s2��������K�#�4��
�
�
�
�
rrcc�(��eZdZdZ�jZd�ZdS)�/TestLongMessage.setUp.<locals>.TestableTestTrueTc��dSr'r(rs rr_z8TestLongMessage.setUp.<locals>.TestableTestTrue.testTest�r`rNrars�r�TestableTestTruere�s2��������K�#�4��
�
�
�
�
rrgr_)rOrP�testableTrue�
testableFalse)rrcrgs`  r�setUpzTestLongMessage.setUp�s����	�	�	�	�	�	�	�� 1�	�	�	�	�	�	�	�	�	�	�x�0�	�	�	�-�,�Z�8�8���.�.�z�:�:����rc�N�|�tjj��dSr')�
assertTruerOrPrbrs r�testDefaultzTestLongMessage.testDefault�s ������)�5�6�6�6�6�6rc���|�|j�dd��d��|�|j�dd��d��|�|j�dd��d��|�|j�dd��d��|j�t	��d��dS)NrH�barz	bar : foo)�assertEqualri�_formatMessagerh�objectrs r�test_formatMsgzTestLongMessage.test_formatMsg�s�������+�:�:�4��G�G��O�O�O�����+�:�:�5�%�H�H�%�P�P�P�����*�9�9�$��F�F��N�N�N�����*�9�9�%��G�G��U�U�U�	
��(�(����5�9�9�9�9�9rc��d�d�td��D����}|j�|d��dS)N�c3�4K�|]}t|��V��dSr')�chr)�.0�is  r�	<genexpr>zCTestLongMessage.test_formatMessage_unicode_error.<locals>.<genexpr>�s(����1�1��c�!�f�f�1�1�1�1�1�1r�u�)�join�rangerhrq)r�ones  r� test_formatMessage_unicode_errorz0TestLongMessage.test_formatMessage_unicode_error�sG���g�g�1�1�e�C�j�j�1�1�1�1�1����(�(��h�7�7�7�7�7rc�������fd�}t|��D]Y\}}||��}i}|dz}	|	rddi}���j|���5||i|��ddd��n#1swxYwY�ZdS)a_
        Check that methodName(*args) raises the correct error messages.
        errors should be a list of 4 regex that match the error when:
          1) longMessage = False and no msg passed;
          2) longMessage = False and msg passed;
          3) longMessage = True and no msg passed;
          4) longMessage = True and msg passed;
        c�R��|dk}|r�j}n�j}t|���S)Nr)rirh�getattr)ry�useTestableFalse�test�
methodNamers   ��r�	getMethodz1TestLongMessage.assertMessages.<locals>.getMethod�s7��� !�A����
)��)����(���4��,�,�,rr�msg�oops)�expected_regexN)�	enumerate�assertRaisesRegexr)
rr�rW�errorsr�ryr��
testMethod�kwargs�withMsgs
``        r�assertMessageszTestLongMessage.assertMessages�s����	-�	-�	-�	-�	-�	-�"+�6�!2�!2�		,�		,��A�~�"��1���J��F��!�e�G��
)������'�'��(=�7E�(�G�G�
,�
,��
�D�+�F�+�+�+�
,�
,�
,�
,�
,�
,�
,�
,�
,�
,�
,����
,�
,�
,�
,��		,�		,s�	A&�&A*	�-A*	c�8�|�ddgd���dS)Nrl)F)�^False is not true$�^oops$r�z^False is not true : oops$�r�rs r�testAssertTruezTestLongMessage.testAssertTrue�s7�����L�(�;�;�;�	<�	<�	<�	<�	<rc�8�|�ddgd���dS)N�assertFalse)T)�^True is not false$r�r�z^True is not false : oops$r�rs r�testAssertFalsezTestLongMessage.testAssertFalse�s7�����M�7�;�;�;�	<�	<�	<�	<�	<rc�8�|�ddgd���dS)N�assertNotEqual�rr)�^1 == 1$r�r�z^1 == 1 : oops$r�rs r�testNotEqualzTestLongMessage.testNotEqual�s8�����,�f�0�0�0�	1�	1�	1�	1�	1rc�8�|�ddgd���dS)Nr
�rr)�)^1 != 2 within 7 places \(1 difference\)$r�r�z0^1 != 2 within 7 places \(1 difference\) : oops$r�rs r�testAlmostEqualzTestLongMessage.testAlmostEqual�s@�������
B�
B�
B�	C�	C�	C�	C�	Crc�8�|�ddgd���dS)Nrr�)�^1 == 1 within 7 places$r�r�z^1 == 1 within 7 places : oops$r�rs r�testNotAlmostEqualz"TestLongMessage.testNotAlmostEqual�s@�����2�F�\�\�\�	]�	]�	]�	]�	]rc�8�|�ddgd���dS)N�_baseAssertEqualr�)�^1 != 2$r�r�z^1 != 2 : oops$r�rs r�test_baseAssertEqualz$TestLongMessage.test_baseAssertEqual�s7�����.��Q�Q�Q�	S�	S�	S�	S�	Src�>�|�dgdgfgd���dS)N�assertSequenceEqual)�\+ \[None\]$r�r�z\+ \[None\] : oops$r�rs r�testAssertSequenceEqualz'TestLongMessage.testAssertSequenceEqual�s@��	
���1�B���<�5�5�5�	6�	6�	6�	6�	6rc�p�|�dt��tdg��fgd���dS)N�assertSetEqual)�None$r�r�zNone : oops$)r��setrs r�testAssertSetEqualz"TestLongMessage.testAssertSetEqual�sI�����,�s�u�u�c�4�&�k�k�.B�-�-�-�	.�	.�	.�	.�	.rc�<�|�ddgfgd���dS)Nr0)�^None not found in \[\]$r�r�z^None not found in \[\] : oops$r�rs r�testAssertInzTestLongMessage.testAssertInsC�����J��r�
�A�A�A�	B�	B�	B�	B�	Brc�>�|�dddgfgd���dS)N�assertNotIn)�%^None unexpectedly found in \[None\]$r�r�z,^None unexpectedly found in \[None\] : oops$r�rs r�testAssertNotInzTestLongMessage.testAssertNotInsE�����M�D�4�&�>�N�N�N�	O�	O�	O�	O�	Orc�@�|�diddifgd���dS)N�assertDictEqualr+�value)�\+ \{'key': 'value'\}$r�r�z\+ \{'key': 'value'\} : oops$r�rs r�testAssertDictEqualz#TestLongMessage.testAssertDictEqualsG�����-��U�G�4D�/E�?�?�?�	@�	@�	@�	@�	@rc���tj��5tjdt��|�dddiifgd���ddd��dS#1swxYwYdS)N�ignore�assertDictContainsSubsetr+r�)�^Missing: 'key'$r�r�z^Missing: 'key' : oops$)�warnings�catch_warnings�simplefilter�DeprecationWarningr�rs r�testAssertDictContainsSubsetz,TestLongMessage.testAssertDictContainsSubsets���
�
$�
&�
&�	=�	=��!�(�,>�?�?�?���� :�e�W�=M�r�<R�!<�!<�!<�
=�
=�
=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=����	=�	=�	=�	=�	=�	=s�8A�A� Ac�8�|�ddgd���dS)N�assertMultiLineEqual)rurH)�\+ foo$r�r�z\+ foo : oops$r�rs r�testAssertMultiLineEqualz(TestLongMessage.testAssertMultiLineEquals8�����2�K�0�0�0�	1�	1�	1�	1�	1rc�8�|�ddgd���dS)N�
assertLess�rr)�^2 not less than 1$r�r�z^2 not less than 1 : oops$r�rs r�testAssertLesszTestLongMessage.testAssertLess!s?�����L�&�R�R�R�	S�	S�	S�	S�	Src�8�|�ddgd���dS)N�assertLessEqualr�)�^2 not less than or equal to 1$r�r�z&^2 not less than or equal to 1 : oops$r�rs r�testAssertLessEqualz#TestLongMessage.testAssertLessEqual&s@�����-�v�G�G�G�	H�	H�	H�	H�	Hrc�8�|�ddgd���dS)N�
assertGreaterr�)�^1 not greater than 2$r�r�z^1 not greater than 2 : oops$r�rs r�testAssertGreaterz!TestLongMessage.testAssertGreater,s7�����O�V�>�>�>�	?�	?�	?�	?�	?rc�8�|�ddgd���dS)N�assertGreaterEqualr�)�"^1 not greater than or equal to 2$r�r�z)^1 not greater than or equal to 2 : oops$r�rs r�testAssertGreaterEqualz&TestLongMessage.testAssertGreaterEqual2s@�����0�&�J�J�J�	K�	K�	K�	K�	Krc�8�|�ddgd���dS)NrR)znot None)�^'not None' is not None$r�r�z^'not None' is not None : oops$r�rs r�testAssertIsNonez TestLongMessage.testAssertIsNone8s?�����N�M�@�@�@�	A�	A�	A�	A�	Arc�8�|�ddgd���dS)N�assertIsNotNoner')�^unexpectedly None$r�r�z^unexpectedly None : oops$r�rs r�testAssertIsNotNonez#TestLongMessage.testAssertIsNotNone>s8�����-�w�;�;�;�	<�	<�	<�	<�	<rc�8�|�ddgd���dS)Nr4�NrH)�^None is not 'foo'$r�r�z^None is not 'foo' : oops$r�rs r�testAssertIszTestLongMessage.testAssertIsDs7�����J�
�;�;�;�	<�	<�	<�	<�	<rc�8�|�ddgd���dS)N�assertIsNot)NN)�^unexpectedly identical: None$r�r�z%^unexpectedly identical: None : oops$r�rs r�testAssertIsNotzTestLongMessage.testAssertIsNotJs?�����M�<�F�F�F�	G�	G�	G�	G�	Grc�8�|�ddgd���dS)N�assertRegex)rHro)�^Regex didn't match:r�r�z!^Regex didn't match: (.*) : oops$r�rs r�testAssertRegexzTestLongMessage.testAssertRegexPs?�����M�>�B�B�B�	C�	C�	C�	C�	Crc�8�|�ddgd���dS)NrV)rHrH)�^Regex matched:r�r�z^Regex matched: (.*) : oops$r�rs rrXz"TestLongMessage.testAssertNotRegexWs8�����,�n�=�=�=�	>�	>�	>�	>�	>rc�R�t|j|jfiddif��}t||��D]u\\}}}t	||��}	|�|j|��5|	|i|��5}
|��ddd��n#1swxYwYddd��n#1swxYwY�vdS)a�
        Check that the correct error messages are raised while executing:
          with method(*args):
              func()
        *errors* should be a list of 4 regex that match the error when:
          1) longMessage = False and no msg passed;
          2) longMessage = False and msg passed;
          3) longMessage = True and no msg passed;
          4) longMessage = True and msg passed;
        r�r�N)rrirh�zipr�r�r)rr�rW�funcr��p�clsr��err�methodr6s           r�assertMessagesCMz TestLongMessage.assertMessagesCM_sF��
�T�'��):�;��%���)�
+�
+��"%�a��.�.�	�	��M�S�&�3��S�*�-�-�F��'�'��(<�c�B�B�
�
��V�T�,�V�,�,����D�F�F�F�������������������
�
�
�
�
�
�
�
�
�
�
����
�
�
�
��	�	s6�$	B�-B�8B�B�B�B�B�B	�"B	c�H�|�dtfd�gd���dS)Nrc��dSr'r(r(rrr-z2TestLongMessage.testAssertRaises.<locals>.<lambda>ss��D�r��^TypeError not raised$r�r�z^TypeError not raised : oops$�r�rrs r�testAssertRaisesz TestLongMessage.testAssertRaisesrsE�����n�y�l�L�L�@�@�@�	A�	A�	A�	A�	Arc��|�dtdfd�gd���d�}|�dtdf|gd���dS)Nr��unused regexc��dSr'r(r(rrr-z7TestLongMessage.testAssertRaisesRegex.<locals>.<lambda>{���d�rr�c� �td���r�)rr(rr�raise_wrong_messagezBTestLongMessage.testAssertRaisesRegex.<locals>.raise_wrong_message�s���E�"�"�"r�regex��^"regex" does not match "foo"$r�rz%^"regex" does not match "foo" : oops$r��rrs  r�testAssertRaisesRegexz%TestLongMessage.testAssertRaisesRegexxs������1�I�~�3N�*�l�@�@�@�	A�	A�	A�	#�	#�	#����1�I�w�3G�1�H�H�H�	I�	I�	I�	I�	Irc�H�|�dtfd�gd���dS)N�assertWarnsc��dSr'r(r(rrr-z1TestLongMessage.testAssertWarns.<locals>.<lambda>�s��T�r��^UserWarning not triggered$r�rz"^UserWarning not triggered : oops$�r��UserWarningrs r�testAssertWarnszTestLongMessage.testAssertWarns�sE�����m�k�^�\�\�E�E�E�	F�	F�	F�	F�	Frc��|�dtdfd�gd���d�}|�dtdf|gd���dS)N�assertWarnsRegexrc��dSr'r(r(rrr-z6TestLongMessage.testAssertWarnsRegex.<locals>.<lambda>�rrrc�.�tjd��dSr�)r��warnr(rrrzATestLongMessage.testAssertWarnsRegex.<locals>.raise_wrong_message�s���M�%� � � � � rrrrr	s  r�testAssertWarnsRegexz$TestLongMessage.testAssertWarnsRegex�s������0�;��2O�*�l�E�E�E�	F�	F�	F�	!�	!�	!����0�;��2H�1�H�H�H�	I�	I�	I�	I�	IrN)%r<r=r>�__doc__rjrmrsrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rXr�r�r
rrr(rrrZrZ�s?������%�%�;�;�;�$7�7�7�:�:�:�8�8�8�
,�,�,�8<�<�<�
<�<�<�
1�1�1�
C�C�C�]�]�]�
S�S�S�6�6�6�.�.�.�
B�B�B�O�O�O�@�@�@�=�=�=�1�1�1�S�S�S�
H�H�H�?�?�?�K�K�K�A�A�A�<�<�<�<�<�<�G�G�G�C�C�C�>�>�>����&A�A�A�I�I�I� F�F�F�I�I�I�I�IrrZ�__main__)
rr�rCrO�test.supportr�	itertoolsrrPrrZr<�mainr(rr�<module>rs�������������������#�#�#�#�#�#�������D<�D<�D<�D<�D<�h�'�D<�D<�D<�NLI�LI�LI�LI�LI�h�'�LI�LI�LI�^�z����H�M�O�O�O�O�O��r

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