Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/test/__pycache__/test_property.cpython-35.opt-2.pyc



���]]!�@slddlZddlZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�Z	Gdd�de�Z
Gdd�de
�ZGdd�de�ZGdd�de�Z
Gdd�dej�ZGdd�de�ZGdd�de�ZGdd�dej�Zedkrhej�dS)�Nc@seZdZdS)�PropertyBaseN)�__name__�
__module__�__qualname__�rr�2/opt/alt/python35/lib64/python3.5/test_property.pyrsrc@seZdZdS)�PropertyGetN)rrrrrrrr
src@seZdZdS)�PropertySetN)rrrrrrrr	
sr	c@seZdZdS)�PropertyDelN)rrrrrrrr
sr
c@sXeZdZdd�Zedd��Zejdd��Zejdd��ZdS)�	BaseClasscCs
d|_dS)N�)�_spam)�selfrrr�__init__szBaseClass.__init__cCs|jS)N)r
)rrrr�spamszBaseClass.spamcCs
||_dS)N)r
)r�valuerrrrscCs
|`dS)N)r
)rrrrr sN)rrrr�propertyr�setter�deleterrrrrrsrc@sReZdZejjdd��Zejdd��Zejdd��ZdS)�SubClasscCst|j��dS)N)rr
)rrrrr&sz
SubClass.spamcCst|j��dS)N)r	r
)rrrrrr+scCst|j��dS)N)r
r
)rrrrr/sN)rrrrr�getterrrrrrrr$src@s4eZdZdZdd�Zeedd�ZdS)�PropertyDocBase�cCs|jS)N)r
)rrrr�	_get_spam5szPropertyDocBase._get_spam�doczspam spam spamN)rrrr
rrrrrrrr3src@s(eZdZejjdd��ZdS)�PropertyDocSubcCs|jS)N)r
)rrrrr:szPropertyDocSub.spamN)rrrrrrrrrrr9src@s(eZdZejjdd��ZdS)�PropertySubNewGettercCsdS)Nrr)rrrrr@szPropertySubNewGetter.spamN)rrrrrrrrrrr?src@s7eZdZedd��Zejdd��ZdS)�PropertyNewGettercCsdS)Nrr)rrrrrFszPropertyNewGetter.spamcCsdS)N�r)rrrrrJsN)rrrrrrrrrrrEsrc@seZdZdd�Zdd�Zejejj	dkd�dd��Z
ejejj	dkd�d	d
��Zdd�Zejejj	dkd�d
d��Z
dd�Zejejj	dkd�dd��Zejejj	dkd�dd��ZdS)�
PropertyTestscCs�t�}|j|jd�|j|jd�d|_|j|jd�|j|jd�t|d�|jt|d��|jt|d��d|_|j|jd�|j|jd�dS)Nr�
rr
�)r�assertEqualrr
�delattrZ
assertTrue�hasattr)r�baserrr�!test_property_decorator_baseclassPs		
	z/PropertyTests.test_property_decorator_baseclasscCsRt�}|jtt|d�|jtt|dd�|jtt|d�dS)Nr)r�assertRaisesr�getattrr	�setattrr
r#)r�subrrr� test_property_decorator_subclass_s	z.PropertyTests.test_property_decorator_subclass�z)Docstrings are omitted with -O2 and abovecCs&t�}|j|jjjd�dS)NzSubClass.getter)rr"�	__class__r�__doc__)rr*rrr�$test_property_decorator_subclass_docfs	z2PropertyTests.test_property_decorator_subclass_doccCs&t�}|j|jjjd�dS)NzBaseClass.getter)rr"r-rr.)rr%rrr�%test_property_decorator_baseclass_docls	z3PropertyTests.test_property_decorator_baseclass_doccCsHt�}t�}|j|jjjd�|j|jjjd�dS)Nzspam spam spam)rrr"r-rr.)rr%r*rrr�test_property_decorator_docrs		z)PropertyTests.test_property_decorator_doccCsnt�}|j|jd�|j|jjjd�t�}|j|jd�|j|jjjd�dS)Nrz
new docstringr)rr"rr-r.r)rZnewgettersubZ	newgetterrrr�!test_property_getter_doc_overridexs		z/PropertyTests.test_property_getter_doc_overridecs�x[ddgdgddfD]>�G�fdd�dt�}|j|jjt���qWGdd	�d	t��|jt��+G�fd
d�dt�}|jjWdQRXdS)NTFr��1cs1eZdZdd�Z�e_ee�ZdS)zEPropertyTests.test_property___isabstractmethod__descriptor.<locals>.CcSsdS)Nr)rrrr�foo�szIPropertyTests.test_property___isabstractmethod__descriptor.<locals>.C.fooN)rrrr5�__isabstractmethod__rr)�valrr�C�s	r8c@s"eZdZdd�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�sr<cs4eZdZdd�Z��e_ee�ZdS)zEPropertyTests.test_property___isabstractmethod__descriptor.<locals>.CcSsdS)Nr)rrrrr5�szIPropertyTests.test_property___isabstractmethod__descriptor.<locals>.C.fooN)rrrr5r6rr)r<rrr8�s)�objectZassertIsr5r6�boolr'r9)rr8r)r<r7r�,test_property___isabstractmethod__descriptor�s" z:PropertyTests.test_property___isabstractmethod__descriptorcCsBtdd�}|j|jd�d|_|j|jd�dS)NrZbasicZextended)rr"r.)r�prrr�"test_property_builtin_doc_writable�s	z0PropertyTests.test_property_builtin_doc_writablecCsdGdd�dt�}|�}|j|jjjd�d|jj_|j|jjjd�dS)Nc@s"eZdZedd��ZdS)zOPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoccSsdS)N�eggsr)rrrrr�szTPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoc.spamN)rrrrrrrrr�PropertyWritableDoc�srCZEggsZSpam)r=r"r-rr.)rrCr*rrr�$test_property_decorator_doc_writable�s
	z2PropertyTests.test_property_decorator_doc_writableN)rrrr&r+�unittest�skipIf�sys�flags�optimizer/r0r1r2r?rArDrrrrrOs	rc@seZdZdS)�PropertySubN)rrrrrrrrJ�srJc@seZdZfZdS)�PropertySubSlotsN)rrr�	__slots__rrrrrK�srKc@s�eZdZdd�Zejejjdkd�dd��Z	ejejjdkd�dd��Z
ejejjdkd�d	d
��ZdS)�PropertySubclassTestscCs?yGdd�dt�}Wntk
r.Yn
Xtd��dS)Nc@s"eZdZedd��ZdS)zFPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.FoocSsdS)Nrr)rrrrr�szKPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo.spamN)rrrrKrrrrr�Foo�srNzAttributeError not raised)r=�AttributeError�	Exception)rrNrrr�#test_slots_docstring_copy_exception�s

z9PropertySubclassTests.test_slots_docstring_copy_exceptionr,z)Docstrings are omitted with -O2 and abovecCs0Gdd�dt�}|j|jjd�dS)Nc@s"eZdZedd��ZdS)z6PropertySubclassTests.test_docstring_copy.<locals>.FoocSsdS)Nrr)rrrrr�sz;PropertySubclassTests.test_docstring_copy.<locals>.Foo.spamN)rrrrJrrrrrrN�srNz!spam wrapped in property subclass)r=r"rr.)rrNrrr�test_docstring_copy�s	z)PropertySubclassTests.test_docstring_copycs�Gdd�dt����}|j|jd�d|_|j|jd�|j�jjd�G�fdd�d��}|�}|j|jd�d|_|j|jd	�|j|jjd�dS)
Nc@sCeZdZdd�Zedd��Zejdd��ZdS)zOPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FoocSs
d|_dS)Nr)r
)rrrrr�szXPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.__init__cSs|jS)N)r
)rrrrr�szTPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.spamcSs
||_dS)N)r
)rrrrrr�sN)rrrrrJrrrrrrrN�srNrr,z!spam wrapped in property subclasscs(eZdZ�jjdd��ZdS)zRPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSubcSs
d|_dS)NrB)r
)rrrrrr�szWPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub.spamN)rrrrrr)rNrr�FooSub�srS�rB)r=r"rr.)rr5rSZfoosubr)rNr�,test_property_setter_copies_getter_docstring�s 
						zBPropertySubclassTests.test_property_setter_copies_getter_docstringcsxGdd�dt�}|j|jjd�Gdd�dt��G�fdd�d��}|j|jjd�dS)Nc@s7eZdZedd��Zejdd��ZdS)zIPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FoocSsdS)Nrr)rrrrr�szNPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo.spamcSsdS)Nr,r)rrrrr�sN)rrrrJrrrrrrrN�srNza new docstringc@s"eZdZedd��ZdS)zMPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBasecSsdS)Nrr)rrrrrszRPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBase.spamN)rrrrJrrrrr�FooBasesrVcs(eZdZ�jjdd��ZdS)zJPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2cSsdS)Nr,r)rrrrrszOPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2.spamN)rrrrrr)rVrr�Foo2srW)r=r"rr.)rrNrWr)rVr�&test_property_new_getter_new_docstring�s
	z<PropertySubclassTests.test_property_new_getter_new_docstringN)rrrrQrErFrGrHrIrRrUrXrrrrrM�s rM�__main__)rGrErPrrr	r
r=rrrrrrZTestCaserrrJrKrMr�mainrrrr�<module>s"
bW