Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_property.cpython-39.pyc

a

��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.9/test/test_property.pyrsrc@seZdZdS)�PropertyGetNrrrrr	r
sr
c@seZdZdS)�PropertySetNrrrrr	rsrc@seZdZdS)�PropertyDelNrrrrr	rsrc@s<eZdZdd�Zedd��Zejdd��Zejdd��ZdS)�	BaseClasscCs
d|_dS)N���_spam��selfrrr	�__init__szBaseClass.__init__cCs|jS)�BaseClass.getterrrrrr	�spamszBaseClass.spamcCs
||_dS�Nr�r�valuerrr	rscCs|`dSrrrrrr	r!sN)rrrr�propertyr�setter�deleterrrrr	r
s

r
c@s8eZdZejjdd��Zejdd��Zejdd��ZdS)�SubClasscCst|j��dS)�SubClass.getterN)r
rrrrr	r'sz
SubClass.spamcCst|j��dSr)rrrrrr	r,scCst|j��dSr)rrrrrr	r0sN)rrrr
r�getterrrrrrr	r%s

rc@s$eZdZdZdd�Zeedd�ZdS)�PropertyDocBase�cCs|jSrrrrrr	�	_get_spam6szPropertyDocBase._get_spam�spam spam spam��docN)rrrrr!rrrrrr	r4src@seZdZejjdd��ZdS)�PropertyDocSubcCs|jS)z*The decorator does not use this doc stringrrrrr	r;szPropertyDocSub.spamN)rrrrrrrrrr	r%:sr%c@seZdZejjdd��ZdS)�PropertySubNewGettercCsdS)�
new docstringrrrrrr	rAszPropertySubNewGetter.spamN)rrrr
rrrrrr	r&@sr&c@s&eZdZedd��Zejdd��ZdS)�PropertyNewGettercCsdS)zoriginal docstringr rrrrr	rGszPropertyNewGetter.spamcCsdS)r'�rrrrr	rKsN)rrrrrrrrrr	r(Fs
r(c@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��Ze�ejj	dkd�dd��Ze�ejj	dkd�dd��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�setattrrr.�r�subrrr	� test_property_decorator_subclass`sz.PropertyTests.test_property_decorator_subclass��)Docstrings are omitted with -O2 and abovecCst�}|�|jjjd�dS)Nr)rr-�	__class__r�__doc__r6rrr	�$test_property_decorator_subclass_docgsz2PropertyTests.test_property_decorator_subclass_doccCst�}|�|jjjd�dS)Nr)r
r-r;rr<r0rrr	�%test_property_decorator_baseclass_docmsz3PropertyTests.test_property_decorator_baseclass_doccCs4t�}t�}|�|jjjd�|�|jjjd�dS)Nr")rr%r-r;rr<)rr1r7rrr	�test_property_decorator_docssz)PropertyTests.test_property_decorator_doccCsPt�}|�|jd�|�|jjjd�t�}|�|jd�|�|jjjd�dS)Nrr'r))r&r-rr;r<r()rZnewgettersubZ	newgetterrrr	�!test_property_getter_doc_overrideysz/PropertyTests.test_property_getter_doc_overridecs�ddgdgddfD],�G�fdd�dt�}|�|jjt���qGdd	�d	t��|�t��,G�fd
d�dt�}|jjWd�n1s�0YdS)NTFr ��1cs"eZdZdd�Z�e_ee�ZdS)�EPropertyTests.test_property___isabstractmethod__descriptor.<locals>.CcSsdSrrrrrr	�foo�s�IPropertyTests.test_property___isabstractmethod__descriptor.<locals>.C.fooN�rrrrD�__isabstractmethod__rr)�valrr	�C�srIc@seZdZdd�ZeZdS)zKPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBoolcSs
t��dSr)�
ValueErrorrrrr	�__bool__�szTPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBool.__bool__N)rrrrK�__len__rrrr	�NotBool�srMcs$eZdZdd�Z��e_ee�ZdS)rCcSsdSrrrrrr	rD�srENrFr)rMrr	rI�s)�objectZassertIsrDrG�boolr3rJ)rrIr)rMrHr	�,test_property___isabstractmethod__descriptor�sz:PropertyTests.test_property___isabstractmethod__descriptorcCs0tdd�}|�|jd�d|_|�|jd�dS)NZbasicr#Zextended)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�eggsrrrrr	r�szTPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoc.spamN)rrrrrrrrr	�PropertyWritableDoc�srUrSZSpam)rNr-r;rr<)rrUr7rrr	�$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)rrWZ	fake_propZrefs_before�irrr	�test_refleaks_in___init__�sz'PropertyTests.test_refleaks_in___init__cCs Gdd�d�}|�|jd�dS)Nc@seZdZeedd���ZdS)z,PropertyTests.test_class_property.<locals>.AcSs
d|jS)NzA doc for %r)r��clsrrr	r<�sz4PropertyTests.test_class_property.<locals>.A.__doc__N)rrr�classmethodrr<rrrr	�A�srcz
A doc for 'A'�r-r<�rrcrrr	�test_class_property�sz!PropertyTests.test_class_propertycCs Gdd�d�}|�|jd�dS)Nc@s eZdZdZeedd���ZdS)z5PropertyTests.test_class_property_override.<locals>.AZFirstcSsdS)N�Secondrr`rrr	r<�sz=PropertyTests.test_class_property_override.<locals>.A.__doc__N)rrrr<rbrrrrr	rc�srcrgrdrerrr	�test_class_property_override�sz*PropertyTests.test_class_property_overrideN)rrrr2r8�unittest�skipIfr\�flags�optimizer=r>r?r@rPrRrVrZ
refcount_testr_rfrhrrrr	r*PsD�
�
�
�
�


�
�r*c@seZdZdZdS)�PropertySubzThis is a subclass of propertyN)rrrr<rrrr	rm�srmc@seZdZdZdZdS)�PropertySubSlotsz5This is a subclass of property that defines __slots__rN)rrrr<�	__slots__rrrr	rn�srnc@sheZdZdd�Ze�ejjdkd�dd��Z	e�ejjdkd�dd��Z
e�ejjdkd�d	d
��ZdS)�PropertySubclassTestscCs4zGdd�dt�}Wnty&Yn
0td��dS)Nc@seZdZedd��ZdS)zFPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.FoocSsdS)z5Trying to copy this docstring will raise an exceptionr rrrrr	r�szKPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo.spamN)rrrrnrrrrr	�Foo�srqzAttributeError not raised)rN�AttributeError�	Exception�rrqrrr	�#test_slots_docstring_copy_exception�s
z9PropertySubclassTests.test_slots_docstring_copy_exceptionr9r:cCs$Gdd�dt�}|�|jjd�dS)Nc@seZdZedd��ZdS)z6PropertySubclassTests.test_docstring_copy.<locals>.FoocSsdS)�!spam wrapped in property subclassr rrrrr	r�sz;PropertySubclassTests.test_docstring_copy.<locals>.Foo.spamN�rrrrmrrrrr	rq�srqrv�rNr-rr<rtrrr	�test_docstring_copy�s
�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>.FoocSs
d|_dS)Nr rrrrr	r��zXPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.__init__cSs|jS)rvrrrrr	r�szTPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.spamcSs
||_dS)zthis docstring is ignoredNrrrrr	r�sN)rrrrrmrrrrrr	rq�s

rqr r9rvcseZdZ�jjdd��ZdS)zRPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSubcSs
d|_dS)zanother ignored docstringrTNrrrrr	rszWPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub.spamN)rrrrrr�rqrr	�FooSubsr|�rTrx)rrDr|Zfoosubrr{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@s&eZdZedd��Zejdd��ZdS)zIPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FoocSsdS�za docstringr rrrrr	rszNPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo.spamcSsdS��a new docstringr9rrrrr	rsN)rrrrmrrrrrr	rqs
rqr�c@seZdZedd��ZdS)zMPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBasecSsdSrrrrrr	r"szRPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBase.spamNrwrrrr	�FooBase!sr�cseZdZ�jjdd��ZdS)zJPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2cSsdSr�rrrrr	r'szOPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2.spamN)rrrrrr�r�rr	�Foo2&sr�rx)rrqr�rr�r	�&test_property_new_getter_new_docstrings
	z<PropertySubclassTests.test_property_new_getter_new_docstringN)rrrrurirjr\rkrlryr~r�rrrr	rp�s�

�
�rp�__main__)r\ri�testrrsrr
rrrNr
rrr%r&r(ZTestCaser*rrmrnrpr�mainrrrr	�<module>s&
W


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