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.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)�BaseClass.getterrrr	r	r
�spam�zBaseClass.spamcCs
||_dS�Nr�r�valuer	r	r
r�
cCs|`dSrrrr	r	r
r!sN)rrrr�propertyr�setter�deleterr	r	r	r
rs

rc@s8eZdZejjdd��Zejdd��Zejdd��ZdS)�SubClasscC�
t|j��)�SubClass.getter)rrrr	r	r
r'�
z
SubClass.spamcCr#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�cCrrrrr	r	r
�	_get_spam6�zPropertyDocBase._get_spam�spam spam spam��docN)rrrrr)rrr	r	r	r
r'4sr'c@�eZdZejjdd��ZdS)�PropertyDocSubcCr)z*The decorator does not use this doc stringrrr	r	r
r;rzPropertyDocSub.spamN)rrrr'rr&r	r	r	r
r/:�r/c@r.)�PropertySubNewGettercC�dS)�
new docstringrr	rr	r	r
rA�zPropertySubNewGetter.spamN)rrrrrr&r	r	r	r
r1@r0r1c@�&eZdZedd��Zejdd��ZdS)�PropertyNewGettercCr2)zoriginal docstringr(r	rr	r	r
rGr4zPropertyNewGetter.spamcCr2)r3�r	rr	r	r
rKr4N)rrrrrr&r	r	r	r
r6F�

r6c@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)Nr$)r"r<�	__class__r�__doc__rEr	r	r
�$test_property_decorator_subclass_docg�z2PropertyTests.test_property_decorator_subclass_doccCrJ)Nr)rr<rKrrLr?r	r	r
�%test_property_decorator_baseclass_docmrNz3PropertyTests.test_property_decorator_baseclass_doccCs4t�}t�}|�|jjjd�|�|jjjd�dS)Nr+)r'r/r<rKrrL)rr@rFr	r	r
�test_property_decorator_docssz)PropertyTests.test_property_decorator_doccCsPt�}|�|jd�|�|jjjd�t�}|�|jd�|�|jjjd�dS)Nrr3r7)r1r<rrKrLr6)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�rrrrV�__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)rTcSrUrr	rr	r	r
rV�rWrXNrYr	)r`r	r
r\�s)�objectZassertIsrVrZ�boolrBr])rr\r	)r`r[r
�,test_property___isabstractmethod__descriptor�s
"�z:PropertyTests.test_property___isabstractmethod__descriptorcCs0tdd�}|�|jd�d|_|�|jd�dS)NZbasicr,Zextended)rr<rL)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>.PropertyWritableDoccSr2)�Eggs�eggsr	rr	r	r
r�r4zTPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoc.spamN)rrrrrr	r	r	r
�PropertyWritableDoc�srirgZSpam)rar<rKrrL)rrirFr	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-�drr:)Zdelta)rZ
get_attribute�sysr�rangerZassertAlmostEqual)rrkZ	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
rL�r%z4PropertyTests.test_class_property.<locals>.A.__doc__N)rrr�classmethodrrLr	r	r	r
�A�srxz
A doc for 'A'�r<rL�rrxr	r	r
�test_class_property�sz!PropertyTests.test_class_propertycCrt)Nc@s eZdZdZeedd���ZdS)z5PropertyTests.test_class_property_override.<locals>.AZFirstcSr2)N�Secondr	rur	r	r
rL�r4z=PropertyTests.test_class_property_override.<locals>.A.__doc__N)rrrrLrwrr	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__)rrdrrr	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_r2)NZabcdefr	)�typ�args�kwargsr	r	r
�__new__�rWzMPropertyTests.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(cSr2�Nr(r	rr	r	r
�<lambda>�szJPropertyTests.test_property_setname_on_property_subclass.<locals>.<lambda>)rr�r�r&)rr�rxrdZnpr	r	r
�*test_property_setname_on_property_subclass�s

z8PropertyTests.test_property_setname_on_property_subclassN)rrrrArG�unittest�skipIfrp�flags�optimizerMrOrPrQrcrerjrZ
refcount_testrsr{r}r�r�r	r	r	r
r9PsJ�
�
�
�
�

�
�
	
r9c@seZdZdZdS)�PropertySubzThis is a subclass of propertyN)rrrrLr	r	r	r
r��sr�c@seZdZdZdZdS)�PropertySubSlotsz5This is a subclass of property that defines __slots__r	N)rrrrL�	__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@rf)zFPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.FoocSr2)z5Trying to copy this docstring will raise an exceptionr(r	rr	r	r
r�r4zKPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo.spamN)rrrr�rr	r	r	r
�Foo��r�zAttributeError not raised)ra�AttributeError�	Exception�rr�r	r	r
�#test_slots_docstring_copy_exception�s��z9PropertySubclassTests.test_slots_docstring_copy_exceptionrHrIcCs$Gdd�dt�}|�|jjd�dS)Nc@rf)z6PropertySubclassTests.test_docstring_copy.<locals>.FoocSr2)�!spam wrapped in property subclassr(r	rr	r	r
rr4z;PropertySubclassTests.test_docstring_copy.<locals>.Foo.spamN�rrrr�rr	r	r	r
r�r�r�r��rar<rrLr�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>.FoocSrr�rrr	r	r
rs
zXPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.__init__cSr)r�rrr	r	r
rrzTPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.spamcSs
||_dS)zthis docstring is ignoredNrrr	r	r
rr%N)rrrrr�rr r	r	r	r
r�s
r�r(rHr�c�eZdZ�jjdd��ZdS)zRPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSubcSs
d|_dS)zanother ignored docstringrhNrrr	r	r
r"r%zWPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub.spamN)rrrrr r	�r�r	r
�FooSub!r0r��rhr�)rrVr�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@r5)zIPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FoocSr2�za docstringr(r	rr	r	r
r3r4zNPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo.spamcSr2��a new docstringrHr	rr	r	r
r7r4N)rrrr�rr&r	r	r	r
r�2r8r�r�c@rf)zMPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBasecSr2r�r	rr	r	r
r=r4zRPropertySubclassTests.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>.Foo2cSr2r�r	rr	r	r
rBr4zOPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2.spamN)rrrrr&r	�r�r	r
�Foo2Ar0r�r�)rr�r�r	r�r
�&test_property_new_getter_new_docstring.s
	z<PropertySubclassTests.test_property_new_getter_new_docstringN)rrrr�r�r�rpr�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)rv�objrur	r	r
�
setUpClassQsz(_PropertyUnreachableAttribute.setUpClasscCs@|�t|�d���
|jjWd�dS1swYdS)Nzunreadable attribute�rr�r�r�rVrr	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�rvr�rwr�r�r�r�r	r	r	r
r�Is
r�c@seZdZdZGdd�d�ZdS)�$PropertyUnreachableAttributeWithNamez
^{} 'foo'$c@seZdZe�ZdS)z(PropertyUnreachableAttributeWithName.clsN)rrrrrVr	r	r	r
rves
rvN)rrrr�rvr	r	r	r
r�bsr�c@s&eZdZdZGdd�d�Ze�e_dS)�"PropertyUnreachableAttributeNoNamez^{}$c@r)z&PropertyUnreachableAttributeNoName.clsNrr	r	r	r
rvlrrvN)rrrr�rvrrVr	r	r	r
r�isr��__main__)rpr��testrr�rrr
rrarr"r'r/r1r6ZTestCaser9rr�r�r�r�r�r�r�mainr	r	r	r
�<module>s0
V	�