Your IP : 216.73.216.213


Current Path : /proc/242857/root/opt/alt/python34/lib64/python3.4/test/__pycache__/
Upload File :
Current File : //proc/242857/root/opt/alt/python34/lib64/python3.4/test/__pycache__/test_property.cpython-34.pyo

�
g f��@s�ddlZddlZddlmZGdd�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�Zdd �Zed!kr�e�ndS)"�N)�run_unittestc@seZdZdS)�PropertyBaseN)�__name__�
__module__�__qualname__�rr�7/opt/alt/python34/lib64/python3.4/test/test_property.pyrsrc@seZdZdS)�PropertyGetN)rrrrrrrr	sr	c@seZdZdS)�PropertySetN)rrrrrrrr
sr
c@seZdZdS)�PropertyDelN)rrrrrrrrsrc@sXeZdZdd�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@sReZdZejjdd��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%src@s4eZdZdZdd�Zeedd�ZdS)�PropertyDocBase�cCs|jS)N)r)rrrr�	_get_spam6szPropertyDocBase._get_spam�doczspam spam spamN)rrrrrrrrrrrr4src@s(eZdZejjdd��ZdS)�PropertyDocSubcCs|jS)z*The decorator does not use this doc string)r)rrrrr;szPropertyDocSub.spamN)rrrrrrrrrrr:src@s(eZdZejjdd��ZdS)�PropertySubNewGettercCsdS)z
new docstringr
r)rrrrrAszPropertySubNewGetter.spamN)rrrrrrrrrrr@src@s7eZdZedd��Zejdd��ZdS)�PropertyNewGettercCsdS)zoriginal docstringrr)rrrrrGszPropertyNewGetter.spamcCsdS)z
new docstring�r)rrrrrKsN)rrrrrrrrrrrFsrc@s�eZdZdd�Zdd�Zejejj	dkd�dd��Z
ejejj	dkd�d	d
��Zdd�Zejejj	dkd�d
d��Z
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_baseclassQs		
	z/PropertyTests.test_property_decorator_baseclasscCsRt�}|jtt|d�|jtt|dd�|jtt|d�dS)Nr)r�assertRaisesr	�getattrr
�setattrrr$)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_docgs	z2PropertyTests.test_property_decorator_subclass_doccCs&t�}|j|jjjd�dS)NzBaseClass.getter)rr#r.rr/)rr&rrr�%test_property_decorator_baseclass_docms	z3PropertyTests.test_property_decorator_baseclass_doccCsHt�}t�}|j|jjjd�|j|jjjd�dS)Nzspam spam spam)rrr#r.rr/)rr&r+rrr�test_property_decorator_docss		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_overrideys		z/PropertyTests.test_property_getter_doc_overridecs�x[ddgdgddfD]>�G�fdd�dt�}|j|jjt���qWGdd	�d	t��|jt��+G�fd
d�dt�}|jjWdQXdS)NTFr��1cs1eZdZdd�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�s	r9c@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)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__descriptorN)rrrr'r,�unittest�skipIf�sys�flags�optimizer0r1r2r3r@rrrrr Ps	r c@seZdZdZdS)�PropertySubzThis is a subclass of propertyN)rrrr/rrrrrF�srFc@seZdZdZfZdS)�PropertySubSlotsz5This is a subclass of property that defines __slots__N)rrrr/�	__slots__rrrrrG�srGc@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)z5Trying to copy this docstring will raise an exceptionrr)rrrrr�szKPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo.spamN)rrrrGrrrrr�Foo�srJzAttributeError not raised)r>�AttributeError�	Exception)rrJrrr�#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)z!spam wrapped in property subclassrr)rrrrr�sz;PropertySubclassTests.test_docstring_copy.<locals>.Foo.spamN)rrrrFrrrrrrJ�srJz!spam wrapped in property subclass)r>r#rr/)rrJrrr�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)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)rrrrrFrrrrrrrJ�srJrr-z!spam wrapped in property subclasscs(eZdZ�jjdd��ZdS)zRPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSubcSs
d|_dS)zanother ignored docstring�eggsN)r)rrrrrr�szWPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub.spamN)rrrrrr)rJrr�FooSub�srP�rO)r>r#rr/)rr6rPZfoosubr)rJr�,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)za docstringrr)rrrrr�szNPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo.spamcSsdS)za new docstringr-r)rrrrr�sN)rrrrFrrrrrrrJ�srJza new docstringc@s"eZdZedd��ZdS)zMPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBasecSsdS)za docstringrr)rrrrr�szRPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBase.spamN)rrrrFrrrrr�FooBase�srScs(eZdZ�jjdd��ZdS)zJPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2cSsdS)za new docstringr-r)rrrrr�szOPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2.spamN)rrrrrr)rSrr�Foo2�srT)r>r#rr/)rrJrTr)rSr�&test_property_new_getter_new_docstring�s
	z<PropertySubclassTests.test_property_new_getter_new_docstringN)rrrrMrArBrCrDrErNrRrUrrrrrI�s rIcCsttt�dS)N)rr rIrrrr�	test_main�srV�__main__)rCrAZtest.supportrrLrr	r
rr>rrrrrrZTestCaser rrFrGrIrVrrrrr�<module>s&
LW