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_property.cpython-310.opt-2.pyc
o

�ii-�@sNddlZddlZddlmZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�ZGdd�de	�Z
Gd
d�de
�ZGdd�de	�ZGdd�de�Z
Gdd�de
�ZGdd�de	�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�dej�ZGdd �d �ZGd!d"�d"eej�ZGd#d$�d$eej�Zed%kr�e��dSdS)&�N)�supportc@�eZdZdS)�PropertyBaseN��__name__�
__module__�__qualname__�r	r	�//usr/local/lib/python3.10/test/test_property.pyr�rc@r)�PropertyGetNrr	r	r	r
rrrc@r)�PropertySetNrr	r	r	r
r
rr
c@r)�PropertyDelNrr	r	r	r
rrrc@s<eZdZdd�Zedd��Zejdd��Zejdd��ZdS)�	BaseClasscC�
d|_dS�N���_spam��selfr	r	r
�__init__s
zBaseClass.__init__cC�	|jS�Nrrr	r	r
�spam�zBaseClass.spamcCs
||_dSrr�r�valuer	r	r
r�
cCs|`dSrrrr	r	r
r!sN)rrrr�propertyr�setter�deleterr	r	r	r
rs

rc@s8eZdZejjdd��Zejdd��Zejdd��ZdS)�SubClasscCs	t|j��r)rrrr	r	r
r'�
z
SubClass.spamcC�
t|j��r)r
rrr	r	r
r,rcCr$r)rrrr	r	r
r0rN)rrrrr�getterr r!r	r	r	r
r"%s

r"c@s$eZdZdZdd�Zeedd�ZdS)�PropertyDocBase�cCs|jSrrrr	r	r
�	_get_spam6�zPropertyDocBase._get_spam�spam spam spam��docN)rrrrr(rrr	r	r	r
r&4sr&c@�eZdZejjdd��ZdS)�PropertyDocSubcCrrrrr	r	r
r;rzPropertyDocSub.spamN)rrrr&rr%r	r	r	r
r.:�r.c@r-)�PropertySubNewGettercC�	dSrr	rr	r	r
rA�zPropertySubNewGetter.spamN)rrrrrr%r	r	r	r
r0@r/r0c@�&eZdZedd��Zejdd��ZdS)�PropertyNewGettercCr1�Nr'r	rr	r	r
rGr2zPropertyNewGetter.spamcCr1)N�r	rr	r	r
rKr2N)rrrrrr%r	r	r	r
r4F�

r4c@seZdZdd�Zdd�Ze�ejj	dkd�dd��Z
e�ejj	dkd�d	d
��Zdd�Ze�ejj	dkd�d
d��Z
dd�Ze�ejj	dkd�dd��Ze�ejj	dkd�dd��Zejdd��Ze�ejj	dkd�dd��Ze�ejj	dkd�dd��Zdd�Zdd�ZdS) �
PropertyTestscCs�t�}|�|jd�|�|jd�d|_|�|jd�|�|jd�t|d�|�t|d��|�t|d��d|_|�|jd�|�|jd�dS)Nr�
rr�)r�assertEqualrr�delattrZ
assertTrue�hasattr�r�baser	r	r
�!test_property_decorator_baseclassQs
z/PropertyTests.test_property_decorator_baseclasscCs<t�}|�tt|d�|�tt|dd�|�tt|d�dS)Nr)r"�assertRaisesr�getattrr
�setattrrr<�r�subr	r	r
� test_property_decorator_subclass`sz.PropertyTests.test_property_decorator_subclass��)Docstrings are omitted with -O2 and abovecC�t�}|�|jjjd�dS)NzSubClass.getter)r"r;�	__class__r�__doc__rDr	r	r
�$test_property_decorator_subclass_docg�z2PropertyTests.test_property_decorator_subclass_doccCrI)NzBaseClass.getter)rr;rJrrKr>r	r	r
�%test_property_decorator_baseclass_docmrMz3PropertyTests.test_property_decorator_baseclass_doccCs4t�}t�}|�|jjjd�|�|jjjd�dS)Nr*)r&r.r;rJrrK)rr?rEr	r	r
�test_property_decorator_docssz)PropertyTests.test_property_decorator_doccCsPt�}|�|jd�|�|jjjd�t�}|�|jd�|�|jjjd�dS)Nrz
new docstringr6)r0r;rrJrKr4)rZnewgettersubZ	newgetterr	r	r
�!test_property_getter_doc_overrideysz/PropertyTests.test_property_getter_doc_overridecs�ddgdgddfD]�G�fdd�dt�}|�|jjt���q	Gdd	�d	t��|�t��G�fd
d�dt�}|jjWd�dS1sGwYdS)NTFr'��1cs"eZdZdd�Z�e_ee�ZdS)�EPropertyTests.test_property___isabstractmethod__descriptor.<locals>.CcS�dSrr	rr	r	r
�foo���IPropertyTests.test_property___isabstractmethod__descriptor.<locals>.C.fooN�rrrrU�__isabstractmethod__rr	)�valr	r
�C�sr[c@seZdZdd�ZeZdS)zKPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBoolcSst��r)�
ValueErrorrr	r	r
�__bool__�r)zTPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBool.__bool__N)rrrr]�__len__r	r	r	r
�NotBool�sr_cs$eZdZdd�Z��e_ee�ZdS)rScSrTrr	rr	r	r
rU�rVrWNrXr	)r_r	r
r[�s)�objectZassertIsrUrY�boolrAr\)rr[r	)r_rZr
�,test_property___isabstractmethod__descriptor�s
"�z:PropertyTests.test_property___isabstractmethod__descriptorcCs0tdd�}|�|jd�d|_|�|jd�dS)NZbasicr+Zextended)rr;rK)r�pr	r	r
�"test_property_builtin_doc_writable�s
z0PropertyTests.test_property_builtin_doc_writablecCsHGdd�dt�}|�}|�|jjjd�d|jj_|�|jjjd�dS)Nc@�eZdZedd��ZdS)zOPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoccSr1�N�eggsr	rr	r	r
r�r2zTPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoc.spamN)rrrrrr	r	r	r
�PropertyWritableDoc�srhZEggsZSpam)r`r;rJrrK)rrhrEr	r	r
�$test_property_decorator_doc_writable�s

z2PropertyTests.test_property_decorator_doc_writablecCsXt�td�}tdddd�}|�}td�D]
}|�dddd�q|j|�|ddd	�dS)
N�gettotalrefcount�fget�fset�fdelr,�drr9)Zdelta)rZ
get_attribute�sysr�rangerZassertAlmostEqual)rrjZ	fake_propZrefs_before�ir	r	r
�test_refleaks_in___init__�sz'PropertyTests.test_refleaks_in___init__cC� Gdd�d�}|�|jd�dS)Nc@seZdZeedd���ZdS)z,PropertyTests.test_class_property.<locals>.AcSs
d|jS)NzA doc for %r)r��clsr	r	r
rK�s
z4PropertyTests.test_class_property.<locals>.A.__doc__N�rrr�classmethodrrKr	r	r	r
�A�srxz
A doc for 'A'�r;rK�rrxr	r	r
�test_class_property�sz!PropertyTests.test_class_propertycCrs)Nc@seZdZ	eedd���ZdS)z5PropertyTests.test_class_property_override.<locals>.AcS�dS)N�Secondr	rtr	r	r
rK�sz=PropertyTests.test_class_property_override.<locals>.A.__doc__Nrvr	r	r	r
rx�s
rxr}ryrzr	r	r
�test_class_property_override�sz*PropertyTests.test_class_property_overridec	CsXt�}dD]$}|�td|�d���|jdg|�Wd�n1s$wYqdS)N)rr'�z3^__set_name__\(\) takes 2 positional arguments but z were given$r)r�assertRaisesRegex�	TypeError�__set_name__)rrcrqr	r	r
�%test_property_set_name_incorrect_args�s
����z3PropertyTests.test_property_set_name_incorrect_argscCsFGdd�dt�}Gdd�d�}t�|�}|�|d�|�dd��}dS)Nc@seZdZdd�ZdS)zEPropertyTests.test_property_setname_on_property_subclass.<locals>.proc_r|)NZabcdefr	)�typ�args�kwargsr	r	r
�__new__�rVzMPropertyTests.test_property_setname_on_property_subclass.<locals>.pro.__new__N)rrrr�r	r	r	r
�pro�sr�c@r)zCPropertyTests.test_property_setname_on_property_subclass.<locals>.ANrr	r	r	r
rx�rrxr'cSr|r5r	rr	r	r
�<lambda>�szJPropertyTests.test_property_setname_on_property_subclass.<locals>.<lambda>)rr�r�r%)rr�rxrcZnpr	r	r
�*test_property_setname_on_property_subclass�s

z8PropertyTests.test_property_setname_on_property_subclassN)rrrr@rF�unittest�skipIfro�flags�optimizerLrNrOrPrbrdrirZ
refcount_testrrr{r~r�r�r	r	r	r
r8PsJ�
�
�
�
�

�
�
	
r8c@r)�PropertySubNrr	r	r	r
r��rr�c@seZdZ	dZdS)�PropertySubSlotsr	N)rrr�	__slots__r	r	r	r
r��sr�c@sheZdZdd�Ze�ejjdkd�dd��Z	e�ejjdkd�dd��Z
e�ejjdkd�d	d
��ZdS)�PropertySubclassTestscCs0z
Gdd�dt�}Wtd��tyYdSw)Nc@re)zFPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.FoocSr1r5r	rr	r	r
r�r2zKPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo.spamN)rrrr�rr	r	r	r
�Foo��r�zAttributeError not raised)r`�AttributeError�	Exception�rr�r	r	r
�#test_slots_docstring_copy_exception�s��z9PropertySubclassTests.test_slots_docstring_copy_exceptionrGrHcCs$Gdd�dt�}|�|jjd�dS)Nc@re)z6PropertySubclassTests.test_docstring_copy.<locals>.FoocSr1r5r	rr	r	r
rr2z;PropertySubclassTests.test_docstring_copy.<locals>.Foo.spamN�rrrr�rr	r	r	r
r�r�r��!spam wrapped in property subclass�r`r;rrKr�r	r	r
�test_docstring_copys
�z)PropertySubclassTests.test_docstring_copycs�Gdd�dt����}|�|jd�d|_|�|jd�|��jjd�G�fdd�d��}|�}|�|jd�d|_|�|jd	�|�|jjd�dS)
Nc@s.eZdZdd�Zedd��Zejdd��ZdS)zOPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FoocSrr5rrr	r	r
rs
zXPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.__init__cSrrrrr	r	r
rrzTPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.spamcSs	||_dSrrrr	r	r
rr#N)rrrrr�rr r	r	r	r
r�s
r�r'rGr�c�eZdZ�jjdd��ZdS)zRPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSubcSs	d|_dSrfrrr	r	r
r"r#zWPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub.spamN)rrrrr r	�r�r	r
�FooSub!r/r��rgr�)rrUr�Zfoosubr	r�r
�,test_property_setter_copies_getter_docstring
s$
��zBPropertySubclassTests.test_property_setter_copies_getter_docstringcsXGdd�dt�}|�|jjd�Gdd�dt��G�fdd�d��}|�|jjd�dS)Nc@r3)zIPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FoocSr1r5r	rr	r	r
r3r2zNPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo.spamcSr1�NrGr	rr	r	r
r7r2N)rrrr�rr%r	r	r	r
r�2r7r�za new docstringc@re)zMPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBasecSr1r5r	rr	r	r
r=r2zRPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBase.spamNr�r	r	r	r
�FooBase<r�r�cr�)zJPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2cSr1r�r	rr	r	r
rBr2zOPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2.spamN)rrrrr%r	�r�r	r
�Foo2Ar/r�r�)rr�r�r	r�r
�&test_property_new_getter_new_docstring.s
	z<PropertySubclassTests.test_property_new_getter_new_docstringN)rrrr�r�r�ror�r�r�r�r�r	r	r	r
r��s�

�
�r�c@sDeZdZdZdZdZdd�Zedd��Zdd�Z	dd	�Z
d
d�ZdS)�_PropertyUnreachableAttributeNcCs|j�|�Sr)�
msg_format�format)r�msgr	r	r
�_format_exc_msgNsz-_PropertyUnreachableAttribute._format_exc_msgcCs|��|_dSr)ru�objrtr	r	r
�
setUpClassQsz(_PropertyUnreachableAttribute.setUpClasscCs@|�t|�d���
|jjWd�dS1swYdS)Nzunreadable attribute�r�r�r�r�rUrr	r	r
�test_get_propertyU�
"�z/_PropertyUnreachableAttribute.test_get_propertycCs@|�t|�d���
d|j_Wd�dS1swYdS)Nzcan't set attributer�rr	r	r
�test_set_propertyYr�z/_PropertyUnreachableAttribute.test_set_propertycCs>|�t|�d���|j`Wd�dS1swYdS)Nzcan't delete attributer�rr	r	r
�test_del_property]s"�z/_PropertyUnreachableAttribute.test_del_property)rrrr�r�rur�rwr�r�r�r�r	r	r	r
r�Is
r�c@seZdZdZGdd�d�ZdS)�$PropertyUnreachableAttributeWithNamez
^{} 'foo'$c@seZdZe�ZdS)z(PropertyUnreachableAttributeWithName.clsN)rrrrrUr	r	r	r
rues
ruN)rrrr�rur	r	r	r
r�bsr�c@s&eZdZdZGdd�d�Ze�e_dS)�"PropertyUnreachableAttributeNoNamez^{}$c@r)z&PropertyUnreachableAttributeNoName.clsNrr	r	r	r
rulrruN)rrrr�rurrUr	r	r	r
r�isr��__main__)ror��testrr�rrr
rr`rr"r&r.r0r4ZTestCaser8rr�r�r�r�r�r�r�mainr	r	r	r
�<module>s0
V	�