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.10/test/__pycache__/test_bool.cpython-310.opt-2.pyc
o

�i�2�@sFddlZddlmZddlZGdd�dej�Zedkr!e��dSdS)�N)�	os_helperc@s�eZdZdd�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;S)<�BoolTestcCsHz
Gdd�dt�}Wn	tyYnw|�d�|�ttjtd�dS)Nc@seZdZdS)z!BoolTest.test_subclass.<locals>.CN)�__name__�
__module__�__qualname__�rr�+/usr/local/lib/python3.10/test/test_bool.py�Csr	zbool should not be subclassabler)�bool�	TypeErrorZfail�assertRaises�int�__new__)�selfr	rrr�
test_subclass
s�
zBoolTest.test_subclasscCsL|�td�d�|�td�d�|�ttd��d�|�ttd��d�dS�NF�FalseT�True)�assertEqual�repr�assertIs�eval�rrrr�	test_reprszBoolTest.test_reprcCs$|�td�d�|�td�d�dSr)r�strrrrr�test_str�zBoolTest.test_strcC�D|�td�d�|�td�d�|�td�d�|�td�d�dS)NFrT�)rr
�assertIsNotrrrr�test_int�zBoolTest.test_intcCr)NF�T��?)r�floatrrrrr�
test_float%r!zBoolTest.test_floatcCsD|�td�d�|�td�d�|�td�d�|�td�d�dS)NFyTy�?)r�complexrrrr�test_complex+r!zBoolTest.test_complexc	Cs(|�dd�|�dd�|�dd�|�dd�|�td�d�|�td�d�|�dd�|�dd�|�dd�|�td�d�|�td�d�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�d	d�|�d	d�|�d
d�|�d
d�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�dD]#}dD]}|�||t|�|�|�||tt|�|���q�qdD�]}dD]�}|�||@tt|�t|�@��|�||Btt|�t|�B��|�||Att|�t|�A��|�|t|�@t|�t|�@�|�|t|�@tt|�t|�@��|�|t|�Bt|�t|�B�|�|t|�Btt|�t|�B��|�|t|�At|�t|�A�|�|t|�Att|�t|�A��|�t|�|@t|�t|�@�|�t|�|@tt|�t|�@��|�t|�|Bt|�t|�B�|�t|�|Btt|�t|�B��|�t|�|At|�t|�A�|�t|�|Att|�t|�A���q=�q8|�ddkd�|�ddkd�|�ddkd�|�ddkd�|�ddkd�|�ddkd�|�ddkd�|�ddkd�|�ddkd�|�ddkd�|�ddkd�|�ddkd�dg}|�||ud�|�||ud�|�d|vd�|�d|vd�|�d|vd�|�d|vd�ddi}|�||ud�|�||ud�|�d|vd�|�d|vd�|�d|vd�|�d|vd�|�dd�|�dd�dS)
NrFrT��������r#r")FT)rrr*)rr�absr
r
r)r�b�i�a�xrrr�	test_math1s� �
    $ $ $ $ $ (�zBoolTest.test_mathcCs�|�ttdd�|�td�d�|�td�d�|�td�d�|�td�d�|�td�d�|�td	�d�|�t�d�dS)
N�*�
Trr(rFZhello�)rrr
rrrrr�test_convert�szBoolTest.test_convertcCs<|�td��tdd�Wd�dS1swYdS)Nzkeyword argumentr3�r0)ZassertRaisesRegexrr
rrrr�test_keyword_args�s"�zBoolTest.test_keyword_argscCsD|�ddd�|�ddd�|�ddd�|�ddd�dS)Nz%dF�0T�1z%x)rrrrr�test_format�r!zBoolTest.test_formatcCs(|�tgd�d�|�tgd�d�dS)N�appendTZwobbleF)r�hasattrrrrr�test_hasattr��zBoolTest.test_hasattrcCs$|�tt�d�|�td�d�dS)NTrF)r�callable�lenrrrr�
test_callable�rzBoolTest.test_callablecCsp|�tdt�d�|�tdt�d�|�tdt�d�|�tdt�d�|�tdt�d�|�tdt�d�dS)NTFrr)r�
isinstancer
r
rrrr�test_isinstance�szBoolTest.test_isinstancecCs(|�ttt�d�|�ttt�d�dS)NTF)r�
issubclassr
r
rrrr�test_issubclass�r>zBoolTest.test_issubclasscCs(|�divd�|�dddivd�dS)NrFT)rrrrr�
test_contains�szBoolTest.test_containscCs�|�d�d�d�|�d�d�d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d	��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d
��d�|�d��d�|�d��d�|�d	��d�|�d
�	�d�|�d�	�d�|�d	�
�d�|�d�
�d�|�d�d�d�|�d�d�d�dS)NZxyz�zTr0FZxyz0123z@#$%Z0123ZXYZ� � u �X)r�endswith�isalnum�isalpha�isdigit�islower�	isdecimal�	isnumeric�isspace�istitle�isupper�
startswithrrrr�test_string�s0zBoolTest.test_stringcCsp|�dd�|�dt�|�dd�|�dd�|�dt�|�dd�|�dd�|�dt�|�dd�dS)NrTrF)rZassertNotIsInstancer
rrrrr�test_boolean�szBoolTest.test_booleanc	Csnz/ttjddd��}|�|jd�Wd�n1swY|�|jd�Wt�tj�dSt�tj�w)N�wzutf-8)�encodingFT)�openrZTESTFNr�closed�os�remove)r�frrr�test_fileclosed�s�zBoolTest.test_fileclosedcCs4tttttttttt	t
fD]
}|�t|�d�q
dS)NT)r
r&�dictr$r
�list�object�setr�tuple�typer)r�trrr�
test_types�s
��zBoolTest.test_typescCs�ddl}|�|�d�d�|�|�d�d�|�|�d�d�|�|�d�d�|�|�gd�d�|�|�dgd�d�|�|�dd�d�|�|�dd�d�|�|�dd�d�|�|�dd�d�|�|�dd�d�|�|�dd�d�dS)NrFrT)�operatorr�truth�not_�contains�lt�is_�is_not)rrhrrr�
test_operator�szBoolTest.test_operatorcCs<ddl}|�|�|�d��d�|�|�|�d��d�dS)NrTF)�marshalr�loads�dumps)rrprrr�test_marshalszBoolTest.test_marshalc	CsTddl}t|jd�D]}|�|�|�d|��d�|�|�|�d|��d�qdS)NrrTF)�pickle�range�HIGHEST_PROTOCOLrrqrr)rrt�protorrr�test_pickles
�zBoolTest.test_picklecCs�ddl}|�|jddd�d�|�|jddd�d�|�|jddd�d�|�|jddd�d�|�|jddd�d	�|�|jddd�d
�dS)NrT)�protocolsI01
.FsI00
.rr*s��.s��.)rtrrr)rrtrrr�test_picklevaluesszBoolTest.test_picklevaluescs��fdd�}Gdd�dt�}||��Gdd�dt�}||��Gdd�dt�}||��Gd	d
�d
t�}||��Gdd�d�}��tt|��dS)
Ncs��tt|�S�N�rrr
)�orrr�<lambda>'sz/BoolTest.test_convert_to_bool.<locals>.<lambda>c@�eZdZdd�ZdS)z*BoolTest.test_convert_to_bool.<locals>.FoocS�|Sr{rrrrr�__bool__)�z3BoolTest.test_convert_to_bool.<locals>.Foo.__bool__N�rrrr�rrrr�Foo(�r�c@r)z*BoolTest.test_convert_to_bool.<locals>.BarcS�dS)NZYesrrrrrr�.r�z3BoolTest.test_convert_to_bool.<locals>.Bar.__bool__Nr�rrrr�Bar-r�r�c@r)z*BoolTest.test_convert_to_bool.<locals>.BazcSr�r{rrrrrr�3r�z3BoolTest.test_convert_to_bool.<locals>.Baz.__bool__Nr�rrrr�Baz2r�r�c@r)z+BoolTest.test_convert_to_bool.<locals>.SpamcSr�)Nrrrrrrr�9r�z4BoolTest.test_convert_to_bool.<locals>.Spam.__bool__Nr�rrrr�Spam8r�r�c@r)z+BoolTest.test_convert_to_bool.<locals>.EggscSr�)Nr(rrrrr�__len__>r�z3BoolTest.test_convert_to_bool.<locals>.Eggs.__len__N�rrrr�rrrr�Eggs=r�r�)rbr
r�
ValueErrorr
)r�checkr�r�r�r�r�rrr�test_convert_to_bool#s



zBoolTest.test_convert_to_boolcCs,|�t�dd�d�|�t�dd�d�dS)Ns�bigFsabcd�littleT)rr
�
from_bytesrrrr�test_from_bytesBszBoolTest.test_from_bytescs�dD]H�G�fdd�d�}zt|��WqtyJ}z*zt|��Wnty?}z|�t|�t|��WYd}~nd}~wwWYd}~qd}~wwdS)N)Zillegalr(lcseZdZ�fdd�ZdS)z!BoolTest.test_sane_len.<locals>.Acs�Sr{rr�Zbadvalrrr�Kr�z)BoolTest.test_sane_len.<locals>.A.__len__Nr�rr�rr�AJsr�)r
�	Exceptionr@rr)rr�Ze_boolZe_lenrr�r�
test_sane_lenFs �����zBoolTest.test_sane_lencCs@Gdd�d�}|�tt|��Gdd�d�}|�tt|��dS)Nc@seZdZdZdS)z BoolTest.test_blocked.<locals>.ANr�rrrrr�Vsr�c@seZdZdd�ZdZdS)z BoolTest.test_blocked.<locals>.BcSr�)Nr3rrrrrr�[r�z(BoolTest.test_blocked.<locals>.B.__len__N)rrrr�r�rrrr�BZsr�r|)rr�r�rrr�test_blockedUszBoolTest.test_blockedcCs�|�djd�|�djd�|�tdj�t�|�tdj�t�|�djd�|�djd�|�tdj�t�|�tdj�t�dS)NTrrF)r�real�imagrrer
rrrr�test_real_and_imag`szBoolTest.test_real_and_imagcCs6Gdd�d�}dd�}|�}||�|�|jd�dS)Nc@seZdZdd�Zdd�ZdS)z2BoolTest.test_bool_called_at_least_once.<locals>.XcSs
d|_dS)Nr��countrrrr�__init__ls
z;BoolTest.test_bool_called_at_least_once.<locals>.X.__init__cSs|jd7_dS)NrTr�rrrrr�nsz;BoolTest.test_bool_called_at_least_once.<locals>.X.__bool__N)rrrr�r�rrrrrJksrJcSs
|s	dSr{rr6rrrr^rsz2BoolTest.test_bool_called_at_least_once.<locals>.fr)ZassertGreaterEqualr�)rrJr^r0rrr�test_bool_called_at_least_oncejs
z'BoolTest.test_bool_called_at_least_onceN) rrrrrrr r%r'r1r5r7r:r=rArCrErFrVrWr_rgrorsrxrzr�r�r�r�r�r�rrrrrs<m



r�__main__)ZunittestZtest.supportrr\ZTestCaserr�mainrrrr�<module>su�