Your IP : 216.73.216.213


Current Path : /opt/alt/python34/lib64/python3.4/test/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/test/__pycache__/test_super.cpython-34.pyo

�
g f��@s
dZddlZddlZddlmZGdd�d�ZGdd�de�ZGdd	�d	e�ZGd
d�dee�ZGdd
�d
e�Z	Gdd�de	�Z
Gdd�de�ZGdd�dej�Z
dd�Zedkrej�ndS)z*Unit tests for new super() implementation.�N)�supportc@s.eZdZdd�Zedd��ZdS)�AcCsdS)Nr�)�selfrr�4/opt/alt/python34/lib64/python3.4/test/test_super.py�f	szA.fcCs
|dfS)Nrr)�clsrrr�cmszA.cmN)�__name__�
__module__�__qualname__r�classmethodr	rrrrrsrcs:eZdZ�fdd�Ze�fdd��Z�S)�Bcst�j�dS)Nr)�superr)r)�	__class__rrrszB.fcs|t�j�dfS)Nr)rr	)r)rrrr	szB.cm)r
rrrr
r	rr)rrrsrcs:eZdZ�fdd�Ze�fdd��Z�S)�Ccst�j�dS)Nr)rr)r)rrrrszC.fcs|t�j�dfS)Nr)rr	)r)rrrr	szC.cm)r
rrrr
r	rr)rrrsrcs4eZdZ�fdd�Z�fdd�Z�S)�Dcst�j�dS)Nr)rr)r)rrrrszD.fcs|t�j�dfS)Nr)rr	)r)rrrr	 szD.cm)r
rrrr	rr)rrrsrc@seZdZdS)�EN)r
rrrrrrr#src@seZdZejZdS)�FN)r
rrrrrrrrr&src@seZdZdS)�GN)r
rrrrrrr)srcs�eZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�fdd�Zdd�Zdd�Z
dd�Z�fdd�Zdd�Z�S)�	TestSupercs
t�dS)N)r)r)rrr�tearDown/szTestSuper.tearDowncCs|jt�j�d�dS)N�ABCD)�assertEqualrr)rrrr�test_basics_working4szTestSuper.test_basics_workingcCs |jtjt��d�dS)Nr)rrr)rrrr�test_class_getattr_working7sz$TestSuper.test_class_getattr_workingcCs9|jt�j�d�|jtjt��d�dS)Nr)rrr)rrrr�!test_subclass_no_override_working:sz+TestSuper.test_subclass_no_override_workingcCs9|jt�j�d�|jtjt��d�dS)Nr)rrr)rrrr�$test_unbound_method_transfer_working>sz.TestSuper.test_unbound_method_transfer_workingcCsz|jtj�tdf�|jt�j�tdf�|jtj�tdf�|jt�j�tdf�dS)Nr)rrr	r)rrrr� test_class_methods_still_workingBsz*TestSuper.test_class_methods_still_workingcCs�t�}|j|j�|tttdfdfdfdf�t�}|j|j�|tttdfdfdfdf�dS)Nrrrr)rrr	r)r�d�errr�#test_super_in_class_methods_workingHs	7	z-TestSuper.test_super_in_class_methods_workingcCs3Gdd�dt�}|j|�j�d�dS)Ncs"eZdZ�fdd�Z�S)z,TestSuper.test_super_with_closure.<locals>.Ecs#�fdd�}t�j�dS)Ncs�dS)Nrr)rrr�nestedSsz>TestSuper.test_super_with_closure.<locals>.E.f.<locals>.nestedr)rr)rr")r)rrrRsz.TestSuper.test_super_with_closure.<locals>.E.f)r
rrrrr)rrrQsrZAE)rrr)rrrrr�test_super_with_closureNsz!TestSuper.test_super_with_closurecs2Gdd�dt�}|�}|j|j�d�|j|jd�G�fdd�d�}|j|jt|��|jt��}t	dt
�i�WdQX|jt|j�t�Gdd�d�}|jt
�dd	�t
�d=|jd|j
�G�fd
d�d�}|j�d	�dS)Ncs(eZdZ�fdd�ZdZ�S)z7TestSuper.test_various___class___pathologies.<locals>.Xcs
t�j�S)N)rr)r)rrrr\sz9TestSuper.test_various___class___pathologies.<locals>.X.fi�)r
rrrrrr)rr�X[sr$ri�cs(eZdZ�Z�fdd�Z�S)z7TestSuper.test_various___class___pathologies.<locals>.Xcs�dS)Nrr)rrrrdsz9TestSuper.test_various___class___pathologies.<locals>.X.f)r
rr�xrr)r)rrr$bszYclass X:
                __class__
                def f():
                    __class__cs(eZdZda�fdd�Z�S)z7TestSuper.test_various___class___pathologies.<locals>.X�*cs�dS)Nrr)rrrrpsz9TestSuper.test_various___class___pathologies.<locals>.X.f)r
rrrrrr)rrr$msrr&cs(eZdZd��fdd�Z�S)z7TestSuper.test_various___class___pathologies.<locals>.Xr&cs�dS)Nrr)rrrrxsz9TestSuper.test_various___class___pathologies.<locals>.X.f)r
rrrr)r)rrr$us)rrrr�assertIsr%�type�assertRaises�	NameError�exec�globalsZ	exceptionZassertNotIn�__dict__)rr$r%r )rrr�"test_various___class___pathologiesYs 	
z,TestSuper.test_various___class___pathologiescCs0Gdd�d�}|j|�j�|�dS)Ncs"eZdZ�fdd�Z�S)z2TestSuper.test___class___instancemethod.<locals>.Xcs�S)Nr)r)rrrrsz4TestSuper.test___class___instancemethod.<locals>.X.f)r
rrrrr)rrr$~sr$)r'r)rr$rrr�test___class___instancemethod|sz'TestSuper.test___class___instancemethodcCs-Gdd�d�}|j|j�|�dS)Ncs(eZdZe�fdd��Z�S)z/TestSuper.test___class___classmethod.<locals>.Xcs�S)Nr)r)rrrr�sz1TestSuper.test___class___classmethod.<locals>.X.f)r
rrr
rrr)rrr$�sr$)r'r)rr$rrr�test___class___classmethod�sz$TestSuper.test___class___classmethodcCs-Gdd�d�}|j|j�|�dS)Ncs(eZdZe�fdd��Z�S)z0TestSuper.test___class___staticmethod.<locals>.Xcs�S)Nrr)rrrr�sz2TestSuper.test___class___staticmethod.<locals>.X.f)r
rr�staticmethodrrr)rrr$�sr$)r'r)rr$rrr�test___class___staticmethod�sz%TestSuper.test___class___staticmethodcst�fdd�}|jt|��fdd�}|jt|d�Gdd�d�}|jt|�j�dS)Ncst�dS)N)rr)rrrr�sz.TestSuper.test_obscure_super_errors.<locals>.fcs~t�dS)N)r)r%)rrrr�scs"eZdZ�fdd�Z�S)z.TestSuper.test_obscure_super_errors.<locals>.Xcs�t�dS)N)r)r%)rrrr�sz0TestSuper.test_obscure_super_errors.<locals>.X.f)r
rrrrr)rrr$�sr$)r)�RuntimeErrorr)rrr$)rrr�test_obscure_super_errors�sz#TestSuper.test_obscure_super_errorscsOGdd�d���fdd�}|�jd}|jt�j|�dS)Ncs"eZdZ�fdd�Z�S)z&TestSuper.test_cell_as_self.<locals>.Xcst�dS)N)r)r)rrr�meth�sz+TestSuper.test_cell_as_self.<locals>.X.meth)r
rrr5rr)rrr$�sr$cs����fdd�}|S)Ncs�S)Nrr)�krr�g�sz1TestSuper.test_cell_as_self.<locals>.f.<locals>.gr)r7)r$)r6rr�s	z&TestSuper.test_cell_as_self.<locals>.fr)�__closure__r)�	TypeErrorr5)rr�cr)r$r�test_cell_as_self�szTestSuper.test_cell_as_self)r
rrrrrrrrr!r#r.r/r0r2r4r;rr)rrr-s#rcCstjt�dS)N)rZrun_unittestrrrrr�	test_main�sr<�__main__)�__doc__�sysZunittestZtestrrrrrrrrZTestCaserr<r
�mainrrrr�<module>s�