Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.11/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.11/test/__pycache__/test_abstract_numbers.cpython-311.pyc

�

SԚg@����dZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
d�ZGd�dej��Z
Gd�dej��Zed	krej��dSdS)
zUnit tests for numbers.py.�N)�Complex�Real�Rational�Integral�Numberc���d�}t|��D];}	t||��}|jrt|||���,#t$rY�8wxYwtj|��|S)Nc��t����N)�NotImplementedError)�args�kwargss  �7/usr/local/lib/python3.11/test/test_abstract_numbers.py�not_implementedz#concretize.<locals>.not_implementeds��!�#�#�#�)�dir�getattr�__isabstractmethod__�setattr�AttributeError�abc�update_abstractmethods)�clsr�name�values    r�
concretizer
s���$�$�$��C������	��C��&�&�E��)�
4���T�?�3�3�3����	�	�	��D�	������s�#�#�#��Js�(?�
A�Ac� �eZdZd�Zd�Zd�ZdS)�TestNumbersc���|�ttt����|�ttt����|�ttt
����|�ttt����|�ttt����|�dtd��j	��|�dtd��j
��|�dtd�������|�dtd�������|�dtd��j��|�dtd��j
��dS)N�ri�����)�
assertTrue�
issubclass�intrrrrr�assertEqual�real�imag�	conjugate�	numerator�denominator��selfs r�test_intzTestNumbers.test_ints^�����
�3��1�1�2�2�2����
�3��1�1�2�2�2����
�3��-�-�.�.�.����
�3��0�0�1�1�1����
�3��/�/�0�0�0�����C��F�F�K�(�(�(�����C��F�F�K�(�(�(�����C��F�F�,�,�.�.�/�/�/�����S��W�W�.�.�0�0�1�1�1�����C��F�F�,�-�-�-�����C��F�F�.�/�/�/�/�/rc�<�|�ttt����|�ttt����|�ttt����|�ttt����|�ttt����|�	dtd��j
��|�	dtd��j��|�	dtd�������|�	dtd�������dS)Ng333333@rg333333�)
�assertFalser"�floatrrr!rrrr$r%r&r'r*s r�
test_floatzTestNumbers.test_float(s$������E�8�4�4�5�5�5�����E�8�4�4�5�5�5����
�5�$�/�/�0�0�0����
�5�'�2�2�3�3�3����
�5�&�1�1�2�2�2�����e�C�j�j�o�.�.�.�����E�#�J�J�O�,�,�,�����e�C�j�j�2�2�4�4�5�5�5�����u�T�{�{�4�4�6�6�7�7�7�7�7rc��|�ttt����|�ttt����|�ttt
����|�ttt����|�ttt����tdd��tdd��}}|�	ttj|��|�	ttj||��|�	tt||��|�	ttj||��|�	tt"|��|�	tt$|��dS)N���r )r.r"�complexrrrr!rr�assertRaises�	TypeError�math�trunc�operator�mod�divmod�floordivr/r#)r+�c1�c2s   r�test_complexzTestNumbers.test_complex4sP������G�X�6�6�7�7�7�����G�X�6�6�7�7�7�����G�T�2�2�3�3�3����
�7�G�4�4�5�5�5����
�7�F�3�3�4�4�4���A�����!���B�����)�T�Z��4�4�4����)�X�\�2�r�:�:�:����)�V�R��4�4�4����)�X�%6��B�?�?�?����)�U�B�/�/�/����)�S�"�-�-�-�-�-rN)�__name__�
__module__�__qualname__r,r0r@�rrrrsA������0�0�0�
8�
8�
8�.�.�.�.�.rrc�&�eZdZd�Zd�Zd�Zd�ZdS)�TestNumbersDefaultMethodsc���tG�fd�dt�����|�t�dd������|�t�dd������|�t�dd������|�t�dd������|��dd��t
dd��z
�dd����|�t
dd���dd��z
�dd����dS)Nc�\��eZdZd�Zed���Zed���Z�fd�Z�fd�Zd�Z	dS)�9TestNumbersDefaultMethods.test_complex.<locals>.MyComplexc�"�||_||_dSr
)�r�i)r+r%r&s   r�__init__zBTestNumbersDefaultMethods.test_complex.<locals>.MyComplex.__init__Is���������rc��|jSr
)rKr*s rr%z>TestNumbersDefaultMethods.test_complex.<locals>.MyComplex.realM�	���v�
rc��|jSr
)rLr*s rr&z>TestNumbersDefaultMethods.test_complex.<locals>.MyComplex.imagQrOrc���t|t��r&�|j|jz|j|jz��St�r
)�
isinstancerr&r%r)r+�other�	MyComplexs  �r�__add__zATestNumbersDefaultMethods.test_complex.<locals>.MyComplex.__add__UsF����e�W�-�-�=�$�9�T�Y���%;�%)�Y���%;�=�=�=�)�)rc�4���|j|j��Sr
)r%r&�r+rTs �r�__neg__zATestNumbersDefaultMethods.test_complex.<locals>.MyComplex.__neg__[s��� �y�$�)��d�i�Z�8�8�8rc���t|t��r |j|jko|j|jkSt|t��r|jdko|j|jkSdS)Nr)rRrr&r%r�r+rSs  r�__eq__z@TestNumbersDefaultMethods.test_complex.<locals>.MyComplex.__eq__^sk���e�W�-�-�O��9��
�2�N�t�y�E�J�7N�N��e�V�,�,�F��9��>�E�d�i�5�:�.E�E�F�FrN)
rArBrCrM�propertyr%r&rUrXr[)rTs�rrTrIGs��������
�
�
��
�
��X�
��
�
��X�
�
*�
*�
*�
*�
*�
9�
9�
9�
9�
9�
F�
F�
F�
F�
FrrTr rr3r2)rrr!�boolr.r$r5rWs @rr@z&TestNumbersDefaultMethods.test_complexFsW���	�	F�	F�	F�	F�	F�	F�	F��	F�	F�
��	F�:	
����Y�Y�q�!�_�_�-�-�.�.�.�����Y�Y�q�!�_�_�-�-�.�.�.�����Y�Y�q�!�_�_�-�-�.�.�.�����i�i��1�o�o�.�.�/�/�/�	
�����1�a���7�1�a�=�=�8�)�)�A�q�/�/�J�J�J�	
�����A�����1�a���8�)�)�A�q�/�/�J�J�J�J�Jrc�D�tGd�dt����}|�t|d��d��d��|�td|d����d��|�t	|d����d��|�|d��jd��|�|d��jd��|�|d	�����d	��dS)
Nc�8�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�3TestNumbersDefaultMethods.test_real.<locals>.MyRealc��||_dSr
��n�r+rcs  rrMz<TestNumbersDefaultMethods.test_real.<locals>.MyReal.__init__s�
������rc��|jSr
rbr*s r�__pos__z;TestNumbersDefaultMethods.test_real.<locals>.MyReal.__pos__v�	���v�
rc�*�t|j��Sr
)r/rcr*s r�	__float__z=TestNumbersDefaultMethods.test_real.<locals>.MyReal.__float__ys���T�V�}�}�$rc��|j|zSr
rbrZs  r�__floordiv__z@TestNumbersDefaultMethods.test_real.<locals>.MyReal.__floordiv__|s���v���&rc��||jzSr
rbrZs  r�
__rfloordiv__zATestNumbersDefaultMethods.test_real.<locals>.MyReal.__rfloordiv__s������&rc��|j|zSr
rbrZs  r�__mod__z;TestNumbersDefaultMethods.test_real.<locals>.MyReal.__mod__�s���v��~�%rc��||jzSr
rbrZs  r�__rmod__z<TestNumbersDefaultMethods.test_real.<locals>.MyReal.__rmod__�s���t�v�~�%rN)
rArBrCrMrgrjrlrnrprrrDrr�MyRealr`qs}������
�
�
�
�
�
�
%�
%�
%�
'�
'�
'�
'�
'�
'�
&�
&�
&�
&�
&�
&�
&�
&rrsr2r3)r r r y�?r�{)rrr$r<r5r%r&r')r+rss  r�	test_realz#TestNumbersDefaultMethods.test_realps(��	�	&�	&�	&�	&�	&�T�	&�	&�
��	&�.	
������q�	�	�1�-�-�v�6�6�6�	
�����6�6�!�9�9�-�-�v�6�6�6�	
���������+�+�T�2�2�2�	
����������+�+�+�	
����������+�+�+�	
��������.�.�0�0�#�6�6�6�6�6rc��tGd�dt����}|�t|dd����d��dS)Nc�@�eZdZd�Zed���Zed���ZdS)�;TestNumbersDefaultMethods.test_rational.<locals>.MyRationalc�"�||_||_dSr
)rc�d)r+r(r)s   rrMzDTestNumbersDefaultMethods.test_rational.<locals>.MyRational.__init__�s��"���$����rc��|jSr
rbr*s rr(zETestNumbersDefaultMethods.test_rational.<locals>.MyRational.numerator�rOrc��|jSr
)rzr*s rr)zGTestNumbersDefaultMethods.test_rational.<locals>.MyRational.denominator�rOrN)rArBrCrMr\r(r)rDrr�
MyRationalrx�sY������
%�
%�
%��
�
��X�
��
�
��X�
�
�
rr}�r3g@)rrr$r/)r+r}s  r�
test_rationalz'TestNumbersDefaultMethods.test_rational�sh��	�	�	�	�	�	��	�	�
��	�	
����z�z�!�Q�/�/�0�0�#�6�6�6�6�6rc��tGd�dt����}|�tj|d����d��|�t|d����d��|�|d��jd��|�|d��jd��dS)Nc� �eZdZd�Zd�Zd�ZdS)�;TestNumbersDefaultMethods.test_integral.<locals>.MyIntegralc��||_dSr
rbrds  rrMzDTestNumbersDefaultMethods.test_integral.<locals>.MyIntegral.__init__�rerc��|jSr
rbr*s rrgzCTestNumbersDefaultMethods.test_integral.<locals>.MyIntegral.__pos__�rhrc��|jSr
rbr*s r�__int__zCTestNumbersDefaultMethods.test_integral.<locals>.MyIntegral.__int__�rhrN)rArBrCrMrgr�rDrr�
MyIntegralr��sA������
�
�
�
�
�
�
�
�
�
�
rr�rtg�^@r )rrr$r:�indexr/r(r))r+r�s  r�
test_integralz'TestNumbersDefaultMethods.test_integral�s���	�	�	�	�	�	��	�	�
��	�	
�����
�
�3���8�8�#�>�>�>�	
����z�z�#���/�/��7�7�7�	
�����C���2�C�8�8�8�	
�����C���4�a�8�8�8�8�8rN)rArBrCr@rurr�rDrrrFrFEsU������(K�(K�(K�T(7�(7�(7�V7�7�7�&9�9�9�9�9rrF�__main__)�__doc__rr8r:�unittest�numbersrrrrrr�TestCaserrFrA�mainrDrr�<module>r�s��� � �
�
�
�
�������������=�=�=�=�=�=�=�=�=�=�=�=�=�=����).�).�).�).�).�(�#�).�).�).�X9�9�9�9�9�� 1�9�9�9�D�z����H�M�O�O�O�O�O��r

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