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: //proc/thread-self/root/usr/local/lib/python3.7/test/__pycache__/test_property.cpython-37.pyc
B

��g#�@sddlZddlZddlmZGdd�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�Zedk�re��dS) �N)�supportc@seZdZdS)�PropertyBaseN)�__name__�
__module__�__qualname__�rr�./usr/local/lib/python3.7/test/test_property.pyrsrc@seZdZdS)�PropertyGetN)rrrrrrrr	sr	c@seZdZdS)�PropertySetN)rrrrrrrr
sr
c@seZdZdS)�PropertyDelN)rrrrrrrrsrc@s<eZdZdd�Zedd��Zejdd��Zejdd��ZdS)�	BaseClasscCs
d|_dS)N�)�_spam)�selfrrr�__init__szBaseClass.__init__cCs|jS)zBaseClass.getter)r)rrrr�spamszBaseClass.spamcCs
||_dS)N)r)r�valuerrrrscCs|`dS)N)r)rrrrr!sN)rrrr�propertyr�setter�deleterrrrrrsrc@s8eZdZejjdd��Zejdd��Zejdd��ZdS)�SubClasscCst|j��dS)zSubClass.getterN)r	r)rrrrr'sz
SubClass.spamcCst|j��dS)N)r
r)rrrrrr,scCst|j��dS)N)rr)rrrrr0sN)rrrrr�getterrrrrrrr%src@s$eZdZdZdd�Zeedd�ZdS)�PropertyDocBase�cCs|jS)N)r)rrrr�	_get_spam6szPropertyDocBase._get_spamzspam spam spam)�docN)rrrrrrrrrrrr4src@seZdZejjdd��ZdS)�PropertyDocSubcCs|jS)z*The decorator does not use this doc string)r)rrrrr;szPropertyDocSub.spamN)rrrrrrrrrrr:src@seZdZejjdd��ZdS)�PropertySubNewGettercCsdS)z
new docstringr
r)rrrrrAszPropertySubNewGetter.spamN)rrrrrrrrrrr@src@s&eZdZedd��Zejdd��ZdS)�PropertyNewGettercCsdS)zoriginal docstringrr)rrrrrGszPropertyNewGetter.spamcCsdS)z
new docstring�r)rrrrrKsN)rrrrrrrrrrrFsrc@s�eZdZdd�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��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�baserrr�!test_property_decorator_baseclassQs
z/PropertyTests.test_property_decorator_baseclasscCs<t�}|�tt|d�|�tt|dd�|�tt|d�dS)Nr)r�assertRaisesr	�getattrr
�setattrrr$)r�subrrr� test_property_decorator_subclass`sz.PropertyTests.test_property_decorator_subclass�z)Docstrings are omitted with -O2 and abovecCst�}|�|jjjd�dS)NzSubClass.getter)rr#�	__class__r�__doc__)rr+rrr�$test_property_decorator_subclass_docgsz2PropertyTests.test_property_decorator_subclass_doccCst�}|�|jjjd�dS)NzBaseClass.getter)rr#r.rr/)rr&rrr�%test_property_decorator_baseclass_docmsz3PropertyTests.test_property_decorator_baseclass_doccCs4t�}t�}|�|jjjd�|�|jjjd�dS)Nzspam spam spam)rrr#r.rr/)rr&r+rrr�test_property_decorator_docssz)PropertyTests.test_property_decorator_doccCsPt�}|�|jd�|�|jjjd�t�}|�|jd�|�|jjjd�dS)Nr
z
new docstringr)rr#rr.r/r)rZnewgettersubZ	newgetterrrr�!test_property_getter_doc_overrideysz/PropertyTests.test_property_getter_doc_overridec	s�xBddgdgddfD],�G�fdd�dt�}|�|jjt���qWGdd	�d	t��|�t��"G�fd
d�dt�}|jjWdQRXdS)NTFr��1cs"eZdZdd�Z�e_ee�ZdS)zEPropertyTests.test_property___isabstractmethod__descriptor.<locals>.CcSsdS)Nr)rrrr�foo�szIPropertyTests.test_property___isabstractmethod__descriptor.<locals>.C.fooN)rrrr6�__isabstractmethod__rr)�valrr�C�sr9c@seZdZdd�ZeZdS)zKPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBoolcSs
t��dS)N)�
ValueError)rrrr�__bool__�szTPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBool.__bool__N)rrrr;�__len__rrrr�NotBool�sr=cs$eZdZdd�Z��e_ee�ZdS)zEPropertyTests.test_property___isabstractmethod__descriptor.<locals>.CcSsdS)Nr)rrrrr6�szIPropertyTests.test_property___isabstractmethod__descriptor.<locals>.C.fooN)rrrr6r7rr)r=rrr9�s)�objectZassertIsr6r7�boolr(r:)rr9r)r=r8r�,test_property___isabstractmethod__descriptor�sz:PropertyTests.test_property___isabstractmethod__descriptorcCs0tdd�}|�|jd�d|_|�|jd�dS)NZbasic)rZextended)rr#r/)r�prrr�"test_property_builtin_doc_writable�s
z0PropertyTests.test_property_builtin_doc_writablecCsHGdd�dt�}|�}|�|jjjd�d|jj_|�|jjjd�dS)Nc@seZdZedd��ZdS)zOPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoccSsdS)�Eggs�eggsr)rrrrr�szTPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoc.spamN)rrrrrrrrr�PropertyWritableDoc�srErCZSpam)r>r#r.rr/)rrEr+rrr�$test_property_decorator_doc_writable�s

z2PropertyTests.test_property_decorator_doc_writablecCs\t�td�}tdddd�}|�}x td�D]}|�dddd�q*W|j|�|ddd	�dS)
N�gettotalrefcount�fget�fset�fdelr�drr!)Zdelta)rZ
get_attribute�sysr�rangerZassertAlmostEqual)rrGZ	fake_propZrefs_before�irrr�test_refleaks_in___init__�sz'PropertyTests.test_refleaks_in___init__N)rrrr'r,�unittest�skipIfrL�flags�optimizer0r1r2r3r@rBrFrZ
refcount_testrOrrrrr Ps	r c@seZdZdZdS)�PropertySubzThis is a subclass of propertyN)rrrr/rrrrrT�srTc@seZdZdZdZdS)�PropertySubSlotsz5This is a subclass of property that defines __slots__rN)rrrr/�	__slots__rrrrrU�srUc@sheZdZdd�Ze�ejjdkd�dd��Z	e�ejjdkd�dd��Z
e�ejjdkd�d	d
��ZdS)�PropertySubclassTestscCs6yGdd�dt�}Wntk
r(Yn
Xtd��dS)Nc@seZdZedd��ZdS)zFPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.FoocSsdS)z5Trying to copy this docstring will raise an exceptionrr)rrrrr�szKPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo.spamN)rrrrUrrrrr�Foo�srXzAttributeError not raised)r>�AttributeError�	Exception)rrXrrr�#test_slots_docstring_copy_exception�s
z9PropertySubclassTests.test_slots_docstring_copy_exceptionr-z)Docstrings are omitted with -O2 and abovecCs$Gdd�dt�}|�|jjd�dS)Nc@seZdZedd��ZdS)z6PropertySubclassTests.test_docstring_copy.<locals>.FoocSsdS)z!spam wrapped in property subclassrr)rrrrr�sz;PropertySubclassTests.test_docstring_copy.<locals>.Foo.spamN)rrrrTrrrrrrX�srXz!spam wrapped in property subclass)r>r#rr/)rrXrrr�test_docstring_copy�sz)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>.FoocSs
d|_dS)Nr)r)rrrrr��zXPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.__init__cSs|jS)z!spam wrapped in property subclass)r)rrrrr�szTPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.spamcSs
||_dS)zthis docstring is ignoredN)r)rrrrrr�sN)rrrrrTrrrrrrrX�srXrr-z!spam wrapped in property subclasscseZdZ�jjdd��ZdS)zRPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSubcSs
d|_dS)zanother ignored docstringrDN)r)rrrrrr�szWPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub.spamN)rrrrrr)rXrr�FooSub�sr^�rD)r>r#rr/)rr6r^Zfoosubr)rXr�,test_property_setter_copies_getter_docstring�s 
zBPropertySubclassTests.test_property_setter_copies_getter_docstringcsXGdd�dt�}|�|jjd�Gdd�dt��G�fdd�d��}|�|jjd�dS)Nc@s&eZdZedd��Zejdd��ZdS)zIPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FoocSsdS)za docstringrr)rrrrrszNPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo.spamcSsdS)za new docstringr-r)rrrrrsN)rrrrTrrrrrrrXsrXza new docstringc@seZdZedd��ZdS)zMPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBasecSsdS)za docstringrr)rrrrr
szRPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBase.spamN)rrrrTrrrrr�FooBasesracseZdZ�jjdd��ZdS)zJPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2cSsdS)za new docstringr-r)rrrrrszOPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2.spamN)rrrrrr)rarr�Foo2srb)r>r#rr/)rrXrbr)rar�&test_property_new_getter_new_docstring�s
	z<PropertySubclassTests.test_property_new_getter_new_docstringN)rrrr[rPrQrLrRrSr\r`rcrrrrrW�s rW�__main__)rLrPZtestrrZrr	r
rr>rrrrrrZTestCaser rrTrUrWr�mainrrrr�<module>s$
lW