B
    ç¹`mP  ã               @   s¢  d dl Z d dlZd dlZG dd„ dejƒZG dd„ dejƒZG dd„ deƒZG dd	„ d	eejƒZG d
d„ deejƒZ	G dd„ deejƒZ
G dd„ de
ƒZG dd„ deƒZG dd„ deejƒZG dd„ deejƒZG dd„ deejƒZG dd„ deejƒZG dd„ dejƒZG dd„ deƒZG dd„ deƒZG d d!„ d!eƒZG d"d#„ d#eƒZG d$d%„ d%eƒZeZd&d'„ ZG d(d)„ d)eƒZG d*d+„ d+eƒZG d,d-„ d-eƒZd.d/„ ZdS )0é    Nc               @   sT   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ ZdS )ÚTestShowSwitchc             C   s   ddl m} |ƒ S )Nr   )Ú
ShowSwitch)Úzope.deprecationr   )Úselfr   © r   ú^/home/kop/projects/devel/pgwui/test_venv/lib/python3.7/site-packages/zope/deprecation/tests.pyÚ_makeOne   s    zTestShowSwitch._makeOnec             C   s.   |   ¡ }|j d¡ | ¡  |  |jg ¡ d S )NF)r   ÚstackÚappendÚonÚassertEqual)r   Úswitchr   r   r   Útest_on
   s    zTestShowSwitch.test_onc             C   s$   |   ¡ }| ¡  |  |jdg¡ d S )NF)r   Úoffr   r	   )r   r   r   r   r   Útest_off   s    zTestShowSwitch.test_offc             C   s.   |   ¡ }|j d¡ | ¡  |  |jg ¡ d S )NF)r   r	   r
   Úresetr   )r   r   r   r   r   Ú
test_reset   s    zTestShowSwitch.test_resetc             C   s   |   ¡ }|  |ƒ d¡ d S )NT)r   r   )r   r   r   r   r   Útest_call_true   s    zTestShowSwitch.test_call_truec             C   s&   |   ¡ }|j d¡ |  |ƒ d¡ d S )NF)r   r	   r
   r   )r   r   r   r   r   Útest_call_false   s    zTestShowSwitch.test_call_falsec             C   s   |   ¡ }|  t|ƒd¡ d S )Nz<ShowSwitch on>)r   r   Úrepr)r   r   r   r   r   Útest_repr_on$   s    zTestShowSwitch.test_repr_onc             C   s(   |   ¡ }|j d¡ |  t|ƒd¡ d S )NFz<ShowSwitch off>)r   r	   r
   r   r   )r   r   r   r   r   Útest_repr_off(   s    zTestShowSwitch.test_repr_offc             C   s$   ddl m} |  |  ¡ j|j¡ d S )Nr   )Ú__show__)r   r   r   r   Ú	__class__)r   r   r   r   r   Útest___show__global-   s    z"TestShowSwitch.test___show__globalN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r   r   r   r   r   r      s   r   c               @   s   e Zd Zdd„ Zdd„ ZdS )ÚTestSuppressorc             C   s   ddl m} |ƒ S )Nr   )Ú
Suppressor)r   r   )r   r   r   r   r   r   2   s    zTestSuppressor._makeOnec          	   C   sP   ddl m} |  |jg ¡ |  ¡  |  |jdg¡ W d Q R X |  |jg ¡ d S )Nr   )r   F)r   r   r   r	   r   )r   r   r   r   r   Útest_it6   s
    
zTestSuppressor.test_itN)r   r   r   r   r    r   r   r   r   r   1   s   r   c               @   s   e Zd Zdd„ Zdd„ ZdS )ÚWarningsSetupBasec             C   s@   ddl m} |j| _|j| _tƒ | _tƒ | _| j|_| j|_d S )Nr   )Údeprecation)	r   r"   ÚwarningsÚoldwarningsr   ÚoldshowÚDummyWarningsModuleÚ	DummyShowÚshow)r   r"   r   r   r   ÚsetUp>   s    zWarningsSetupBase.setUpc             C   s    ddl m} | j|_| j|_d S )Nr   )r"   )r   r"   r$   r#   r%   r   )r   r"   r   r   r   ÚtearDownG   s    zWarningsSetupBase.tearDownN)r   r   r   r)   r*   r   r   r   r   r!   =   s   	r!   c               @   st   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )ÚTestDeprecationProxyc             C   s   ddl m} |S )Nr   )ÚDeprecationProxy)Úzope.deprecation.deprecationr,   )r   r,   r   r   r   Ú_getTargetClassM   s    z$TestDeprecationProxy._getTargetClassc             C   s   |   ¡ }||ƒS )N)r.   )r   ÚmoduleÚclsr   r   r   r   Q   s    zTestDeprecationProxy._makeOnec             C   sF   t ƒ }|  |¡}| dd¡ |  |jt¡ |  | jjdtdfg¡ d S )NÚClassFixtureÚhellozClassFixture: helloé   )Ú_getTestsModuler   Ú	deprecater   r1   r#   ÚwÚDeprecationWarning)r   ÚtestsÚproxyr   r   r   Ú(test_deprecate_and__getattribute__stringU   s    
z=TestDeprecationProxy.test_deprecate_and__getattribute__stringc             C   sH   t ƒ }|  |¡}| ddt¡ |  |jt¡ |  | jjdtdfg¡ d S )Nr1   r2   zClassFixture: hellor3   )r4   r   r5   ÚDummyWarningr   r1   r#   r6   )r   r8   r9   r   r   r   Ú8test_deprecate_and__getattribute__string_with_custom_cls^   s    
zMTestDeprecationProxy.test_deprecate_and__getattribute__string_with_custom_clsc             C   s\   t ƒ }|  |¡}| dd¡ |  |jt¡ |  |jt¡ |  | jjdtdfdtdfg¡ d S )N)r1   ÚClassFixture2r2   zClassFixture: hellor3   zClassFixture2: hello)	r4   r   r5   r   r1   r=   r#   r6   r7   )r   r8   r9   r   r   r   Ú*test_deprecate_and__getattribute__sequenceg   s    
z?TestDeprecationProxy.test_deprecate_and__getattribute__sequencec             C   sF   t ƒ }|  |¡}| dd¡ d| j_|  |jt¡ |  | jjg ¡ d S )Nr1   r2   F)	r4   r   r5   r(   r   r   r1   r#   r6   )r   r8   r9   r   r   r   Ú(test_deprecate_and__getattribute__noshowr   s    
z=TestDeprecationProxy.test_deprecate_and__getattribute__noshowc             C   s$   t ƒ }|  |¡}|  |jtj¡ d S )N)r4   r   r   r   ÚtypesÚ
ModuleType)r   r8   r9   r   r   r   Útest___getattribute____class__{   s    
z3TestDeprecationProxy.test___getattribute____class__c             C   s(   t ƒ }|  |¡}|  t|jƒtj¡ d S )N)r4   r   r   Útyper5   r@   Ú
MethodType)r   r8   r9   r   r   r   Útest___getattribute___deprecate€   s    
z4TestDeprecationProxy.test___getattribute___deprecatec             C   s$   t ƒ }|  |¡}|  tt|d¡ d S )NÚwontbethere)r4   r   ÚassertRaisesÚAttributeErrorÚgetattr)r   r8   r9   r   r   r   Útest___getattribute__missing…   s    
z1TestDeprecationProxy.test___getattribute__missingc             C   s0   t ƒ }|  |¡}ddi|_|  |jddi¡ d S )NÚfooÚbar)r4   r   Ú_DeprecationProxy__deprecatedr   )r   r8   r9   r   r   r   Útest___setattr__ownedŠ   s    

z*TestDeprecationProxy.test___setattr__ownedc             C   s4   t ƒ }|  |¡}zd|_|  |jd¡ W d |`X d S )NrL   )r4   r   rK   r   )r   r8   r9   r   r   r   Útest___setattr__notowned   s    
z-TestDeprecationProxy.test___setattr__notownedc             C   s(   t ƒ }|  |¡}|`|  tt|d¡ d S )NrM   )r4   r   rM   rG   rH   rI   )r   r8   r9   r   r   r   Útest___delattr__owned™   s
    

z*TestDeprecationProxy.test___delattr__ownedc             C   s.   t ƒ }|  |¡}d|_|`|  tt|d¡ d S )NrL   rK   )r4   r   rK   rG   rH   rI   )r   r8   r9   r   r   r   Útest___delattr__notowned    s
    
z-TestDeprecationProxy.test___delattr__notownedN)r   r   r   r.   r   r:   r<   r>   r?   rB   rE   rJ   rN   rO   rP   rQ   r   r   r   r   r+   L   s   				r+   c               @   sl   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ ZdS )ÚTestDeprecatedModulec             C   s   ddl m} |S )Nr   )ÚDeprecatedModule)r-   rS   )r   rS   r   r   r   r.   ¨   s    z$TestDeprecatedModule._getTargetClassc             G   s   |   ¡ }|||f|žŽ S )N)r.   )r   r/   ÚmsgÚargsr0   r   r   r   r   ¬   s    zTestDeprecatedModule._makeOnec             C   s&   t ƒ }|  |d¡}|  |jtj¡ d S )Nr2   )r4   r   r   r   r@   rA   )r   r8   r9   r   r   r   rB   °   s    z3TestDeprecatedModule.test___getattribute____class__c             C   s$   t ƒ }|  |d¡}|  |jd¡ d S )Nr2   )r4   r   r   Ú_DeprecatedModule__msg)r   r8   r9   r   r   r   Útest___getattribute____owned__µ   s    z3TestDeprecatedModule.test___getattribute____owned__c             C   s<   t ƒ }|  |d¡}|  |jt¡ |  | jjdtdfg¡ d S )Nr2   r3   )r4   r   r   r1   r#   r6   r7   )r   r8   r9   r   r   r   Ú test___getattribute___deprecatedº   s    z5TestDeprecatedModule.test___getattribute___deprecatedc             C   s>   t ƒ }|  |dt¡}|  |jt¡ |  | jjdtdfg¡ d S )Nr2   r3   )r4   r   r;   r   r1   r#   r6   )r   r8   r9   r   r   r   Ú0test___getattribute___deprecated_with_custom_clsÃ   s    zETestDeprecatedModule.test___getattribute___deprecated_with_custom_clsc             C   s>   t ƒ }|  |d¡}|  tt|d¡ |  | jjdtdfg¡ d S )Nr2   rF   r3   )	r4   r   rG   rH   rI   r   r#   r6   r7   )r   r8   r9   r   r   r   rJ   Ì   s    z1TestDeprecatedModule.test___getattribute__missingc             C   s<   t ƒ }d| j_|  |d¡}|  |jt¡ |  | jjg ¡ d S )NFr2   )r4   r(   r   r   r   r1   r#   r6   )r   r8   r9   r   r   r   Útest___getattribute___noshowÕ   s    z1TestDeprecatedModule.test___getattribute___noshowc             C   s*   t ƒ }|  |d¡}d|_|  |jd¡ d S )Nr2   rK   )r4   r   rV   r   )r   r8   r9   r   r   r   rN   Ý   s    z*TestDeprecatedModule.test___setattr__ownedc             C   s6   t ƒ }|  |d¡}zd|_|  |jd¡ W d |`X d S )Nr2   rL   )r4   r   rK   r   )r   r8   r9   r   r   r   rO   ã   s    z-TestDeprecatedModule.test___setattr__notownedc             C   s*   t ƒ }|  |d¡}|`|  tt|d¡ d S )Nr2   rV   )r4   r   rV   rG   rH   rI   )r   r8   r9   r   r   r   rP   ì   s
    
z*TestDeprecatedModule.test___delattr__ownedc             C   s0   t ƒ }|  |d¡}d|_|`|  tt|d¡ d S )Nr2   rL   rK   )r4   r   rK   rG   rH   rI   )r   r8   r9   r   r   r   rQ   ó   s
    z-TestDeprecatedModule.test___delattr__notownedN)r   r   r   r.   r   rB   rW   rX   rY   rJ   rZ   rN   rO   rP   rQ   r   r   r   r   rR   §   s   				rR   c               @   s4   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ ZdS )ÚTestDeprecatedGetPropertyc             C   s   ddl m} |S )Nr   )ÚDeprecatedGetProperty)r-   r\   )r   r\   r   r   r   r.   û   s    z)TestDeprecatedGetProperty._getTargetClassc             G   s   |   ¡ }|||f|žŽ S )N)r.   )r   ÚproprT   rU   r0   r   r   r   r   ÿ   s    z"TestDeprecatedGetProperty._makeOnec             C   s^   t ƒ }|  |d¡}|  | dd¡d ¡ |  |jd¡ |  |jd¡ |  | jjdtdfg¡ d S )Nr2   Úinstr0   r3   )	ÚDummyPropertyr   r   Ú__get__r^   r0   r#   r6   r7   )r   r]   r9   r   r   r   Útest___get__  s    z&TestDeprecatedGetProperty.test___get__c             C   s`   t ƒ }|  |dt¡}|  | dd¡d ¡ |  |jd¡ |  |jd¡ |  | jjdtdfg¡ d S )Nr2   r^   r0   r3   )	r_   r   r;   r   r`   r^   r0   r#   r6   )r   r]   r9   r   r   r   Útest___get___with_custom_cls  s    z6TestDeprecatedGetProperty.test___get___with_custom_clsc             C   s^   t ƒ }d| j_|  |d¡}|  | dd¡d ¡ |  |jd¡ |  |jd¡ |  | jj	g ¡ d S )NFr2   r^   r0   )
r_   r(   r   r   r   r`   r^   r0   r#   r6   )r   r]   r9   r   r   r   Útest___get__noshow  s    z,TestDeprecatedGetProperty.test___get__noshowN)r   r   r   r.   r   ra   rb   rc   r   r   r   r   r[   ú   s
   r[   c               @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚTestDeprecatedGetSetPropertyc             C   s   ddl m} |S )Nr   )ÚDeprecatedGetSetProperty)r-   re   )r   re   r   r   r   r.   #  s    z,TestDeprecatedGetSetProperty._getTargetClassc             C   s^   t ƒ }|  |d¡}|  | dd¡d ¡ |  |jd¡ |  |jd¡ |  | jjdtdfg¡ d S )Nr2   r^   r]   r3   )	r_   r   r   Ú__set__r^   r]   r#   r6   r7   )r   r]   r9   r   r   r   Útest___set__'  s    z)TestDeprecatedGetSetProperty.test___set__c             C   s`   t ƒ }|  |dt¡}|  | dd¡d ¡ |  |jd¡ |  |jd¡ |  | jjdtdfg¡ d S )Nr2   r^   r]   r3   )	r_   r   r;   r   rf   r^   r]   r#   r6   )r   r]   r9   r   r   r   Útest___set___with_custom_cls2  s    z9TestDeprecatedGetSetProperty.test___set___with_custom_clsc             C   s^   t ƒ }d| j_|  |d¡}|  | dd¡d ¡ |  |jd¡ |  |jd¡ |  | jj	g ¡ d S )NFr2   r^   r]   )
r_   r(   r   r   r   rf   r^   r]   r#   r6   )r   r]   r9   r   r   r   Útest___set__noshow=  s    z/TestDeprecatedGetSetProperty.test___set__noshowN)r   r   r   r.   rg   rh   ri   r   r   r   r   rd   "  s   rd   c               @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
Ú"TestDeprecatedSetGetDeletePropertyc             C   s   ddl m} |S )Nr   )ÚDeprecatedGetSetDeleteProperty)r-   rk   )r   rk   r   r   r   r.   G  s    z2TestDeprecatedSetGetDeleteProperty._getTargetClassc             C   sN   t ƒ }|  |d¡}|  | d¡d ¡ |  |jd¡ |  | jjdtdfg¡ d S )Nr2   r^   r3   )r_   r   r   Ú
__delete__r^   r#   r6   r7   )r   r]   r9   r   r   r   Útest___delete__K  s    z2TestDeprecatedSetGetDeleteProperty.test___delete__c             C   sP   t ƒ }|  |dt¡}|  | d¡d ¡ |  |jd¡ |  | jjdtdfg¡ d S )Nr2   r^   r3   )r_   r   r;   r   rl   r^   r#   r6   )r   r]   r9   r   r   r   Útest___delete___with_custom_clsU  s    zBTestDeprecatedSetGetDeleteProperty.test___delete___with_custom_clsc             C   sN   t ƒ }|  |d¡}|  | d¡d ¡ |  |jd¡ |  | jjdtdfg¡ d S )Nr2   r^   r3   )r_   r   r   rl   r^   r#   r6   r7   )r   r]   r9   r   r   r   Útest___delete__noshow_  s    z8TestDeprecatedSetGetDeleteProperty.test___delete__noshowN)r   r   r   r.   rm   rn   ro   r   r   r   r   rj   F  s   

rj   c               @   s6   e Zd Zdd„ Zddd„Zdd„ Zdd	„ Zd
d„ ZdS )ÚTestDeprecatedMethodc             G   s   ddl m} |||f|žŽ S )Nr   )ÚDeprecatedMethod)r-   rq   )r   ÚmethodÚmessagerU   rq   r   r   r   Ú_callFUTj  s    zTestDeprecatedMethod._callFUTé   c             C   s   dS )NÚfixturer   )r   ÚaÚbÚcr   r   r   rv   n  s    zTestDeprecatedMethod.fixturec             C   s@   |   | jd¡}|  |ddddd¡ |  | jjdtdfg¡ d S )Nr2   rw   rx   r3   )ry   rv   )rt   rv   r   r#   r6   r7   )r   Úresultr   r   r   r    q  s
    zTestDeprecatedMethod.test_itc             C   sB   |   | jdt¡}|  |ddddd¡ |  | jjdtdfg¡ d S )Nr2   rw   rx   r3   )ry   rv   )rt   rv   r;   r   r#   r6   )r   rz   r   r   r   Útest_it_with_custom_clsy  s
    z,TestDeprecatedMethod.test_it_with_custom_clsc             C   s@   |   | jd¡}d| j_|  |ddddd¡ |  | jjg ¡ d S )Nr2   Frw   rx   r3   )ry   rv   )rt   rv   r(   r   r   r#   r6   )r   rz   r   r   r   Útest_it_noshow  s    z#TestDeprecatedMethod.test_it_noshowN)ru   )r   r   r   rt   rv   r    r{   r|   r   r   r   r   rp   i  s
   
rp   c                   sp   e Zd Z‡ fdd„Z‡ fdd„Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Z‡  ZS )ÚTest_deprecatedc                s   t t| ƒ ¡  tƒ | _d S )N)Úsuperr}   r)   r4   Úmod)r   )r   r   r   r)   ˆ  s    zTest_deprecated.setUpc                s   t t| ƒ ¡  | jtjd< d S )Nzzope.deprecation.tests)r~   r}   r*   r   ÚsysÚmodules)r   )r   r   r   r*   Œ  s    zTest_deprecated.tearDownc             G   s   ddl m} |||f|žŽ S )Nr   )Ú
deprecated)r-   r‚   )r   Úspecrs   rU   r‚   r   r   r   rt     s    zTest_deprecated._callFUTc             C   sJ   |   dd¡ tƒ }|  || j¡ |  |jt¡ |  | jjdtdfg¡ d S )Nr1   r2   zClassFixture: hellor3   )	rt   r4   ÚassertNotEqualr   r   r1   r#   r6   r7   )r   r   r   r   r   Útest_string_specifier”  s    z%Test_deprecated.test_string_specifierc             C   sL   |   ddt¡ tƒ }|  || j¡ |  |jt¡ |  | jjdtdfg¡ d S )Nr1   r2   zClassFixture: hellor3   )	rt   r;   r4   r„   r   r   r1   r#   r6   )r   r   r   r   r   Ú%test_string_specifier_with_custom_cls  s    z5Test_deprecated.test_string_specifier_with_custom_clsc             C   sZ   ddl m} tƒ }||ƒ }tjd< |  dd¡ |  |jt¡ |  | jj	dt
dfg¡ d S )Nr   )r,   zzope.deprecation.testsr1   r2   zClassFixture: hellor3   )r-   r,   r4   r€   r   rt   r   r1   r#   r6   r7   )r   r,   r   Únewr   r   r   Ú1test_string_specifier_sys_modules_already_mutated¦  s    zATest_deprecated.test_string_specifier_sys_modules_already_mutatedc             C   sJ   |   td¡}|  |t¡ |  | jjg ¡ |ƒ  |  | jjdtdfg¡ d S )Nr2   r3   )rt   Úfunctionfixturer„   r   r#   r6   r7   )r   rz   r   r   r   Útest_function_specifier°  s    z'Test_deprecated.test_function_specifierc             C   sL   t ƒ }|  |d¡}|  | jjg ¡ |  |jt¡ |  | jjdtdfg¡ d S )Nr2   r3   )r4   rt   r   r#   r6   r1   r7   )r   r   rz   r   r   r   Útest_module_specifier¹  s    z%Test_deprecated.test_module_specifierc             C   sR   t ƒ }|  |d¡}|  | jjg ¡ |  | dd¡d ¡ |  | jjdtdfg¡ d S )Nr2   r^   r0   r3   )ÚDummyGetPropertyrt   r   r#   r6   r`   r7   )r   r]   rz   r   r   r   Útest_getproperty_specifierÂ  s    z*Test_deprecated.test_getproperty_specifierc             C   sR   t ƒ }|  |d¡}|  | jjg ¡ |  | dd¡d ¡ |  | jjdtdfg¡ d S )Nr2   r^   r]   r3   )ÚDummyGetSetPropertyrt   r   r#   r6   rf   r7   )r   r]   rz   r   r   r   Útest_getsetproperty_specifierË  s    z-Test_deprecated.test_getsetproperty_specifierc             C   sP   t ƒ }|  |d¡}|  | jjg ¡ |  | d¡d ¡ |  | jjdtdfg¡ d S )Nr2   r^   r3   )ÚDummyGetSetDeletePropertyrt   r   r#   r6   rl   r7   )r   r]   rz   r   r   r   Ú#test_getsetdeleteproperty_specifierÔ  s    z3Test_deprecated.test_getsetdeleteproperty_specifier)r   r   r   r)   r*   rt   r…   r†   rˆ   rŠ   r‹   r   r   r‘   Ú__classcell__r   r   )r   r   r}   ‡  s   		
				r}   c               @   s<   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ ZdS )ÚTest_deprecatec             C   s   ddl m} |S )Nr   )r5   )r-   r5   )r   r5   r   r   r   r.   Þ  s    zTest_deprecate._getTargetClassc             G   s   |   ¡ }||f|žŽ S )N)r.   )r   rT   rU   r0   r   r   r   r   â  s    zTest_deprecate._makeOnec             C   s   dS )Né*   r   )r   r   r   r   rv   æ  s    zTest_deprecate.fixturec             C   s<   |   d¡}|tƒ}|  |ƒ d ¡ |  | jjdtdfg¡ d S )Nr2   r3   )r   r‰   r   r#   r6   r7   )r   r9   rz   r   r   r   Útest___call__é  s    
zTest_deprecate.test___call__c             C   s>   |   d¡}|| jƒ}|  |ƒ d¡ |  | jjdtdfg¡ d S )Nrr   r”   r3   )r   rv   r   r#   r6   r7   )r   r9   rz   r   r   r   Útest___call__methodñ  s    

z"Test_deprecate.test___call__methodc             C   s>   |   dt¡}|tƒ}|  |ƒ d ¡ |  | jjdtdfg¡ d S )Nr2   r3   )r   r;   r‰   r   r#   r6   )r   r9   rz   r   r   r   Útest___call__with_custom_clsù  s    z+Test_deprecate.test___call__with_custom_clsN)	r   r   r   r.   r   rv   r•   r–   r—   r   r   r   r   r“   Ý  s   r“   c                   sH   e Zd Z‡ fdd„Z‡ fdd„Zdd„ Zdd„ Zd	d
„ Zdd„ Z‡  Z	S )Ú
Test_movedc                s   t t| ƒ ¡  d S )N)r~   r˜   r)   )r   )r   r   r   r)     s    zTest_moved.setUpc                s   t t| ƒ ¡  tƒ jd= d S )NÚabc)r~   r˜   r*   r4   Ú__dict__)r   )r   r   r   r*     s    zTest_moved.tearDownc             G   s   ddl m} |||f|žŽ S )Nr   )Úmoved)r-   r›   )r   Zto_locationZunsupported_inrU   r›   r   r   r   rt   	  s    zTest_moved._callFUTc             C   s(   |   dd ¡ |  | jjdtdfg¡ d S )Nzzope.deprecation.fixturez=zope.deprecation.tests has moved to zope.deprecation.fixture.é   )rt   r   r#   r6   r7   )r   r   r   r   Útest_unsupported_None  s
    z Test_moved.test_unsupported_Nonec             C   s*   |   dd t¡ |  | jjdtdfg¡ d S )Nzzope.deprecation.fixturez=zope.deprecation.tests has moved to zope.deprecation.fixture.rœ   )rt   r;   r   r#   r6   )r   r   r   r   Ú%test_unsupported_None_with_custom_cls  s
    z0Test_moved.test_unsupported_None_with_custom_clsc             C   s(   |   dd¡ |  | jjdtdfg¡ d S )Nzzope.deprecation.fixturez1.3z}zope.deprecation.tests has moved to zope.deprecation.fixture. Import of zope.deprecation.tests will become unsupported in 1.3rœ   )rt   r   r#   r6   r7   )r   r   r   r   Útest_unsupported_not_None  s
    z$Test_moved.test_unsupported_not_None)
r   r   r   r)   r*   rt   r   rž   rŸ   r’   r   r   )r   r   r˜     s   r˜   c               @   s   e Zd Zdd„ ZdS )ÚTest_import_aliasesc             C   sD   x>dD ]6}t tjd |ƒ}t tjd |ƒ}|  ||||f¡ qW d S )N)r‚   r5   r›   r   r   zzope.deprecation.deprecationzzope.deprecation)rI   r€   r   r   )r   ÚnameÚrealÚaliasr   r   r   r    $  s    
zTest_import_aliases.test_itN)r   r   r   r    r   r   r   r   r    #  s   r    c               @   s   e Zd Zdd„ Zdd„ ZdS )r&   c             C   s
   g | _ d S )N)r6   )r   r   r   r   Ú__init__,  s    zDummyWarningsModule.__init__c             C   s   | j  |||f¡ d S )N)r6   r
   )r   rT   rC   Ú
stacklevelr   r   r   Úwarn/  s    zDummyWarningsModule.warnN)r   r   r   r¤   r¦   r   r   r   r   r&   +  s   r&   c               @   s   e Zd Zdd„ ZdS )rŒ   c             C   s   || _ || _d S )N)r^   r0   )r   r^   r0   r   r   r   r`   3  s    zDummyGetProperty.__get__N)r   r   r   r`   r   r   r   r   rŒ   2  s   rŒ   c               @   s   e Zd Zdd„ ZdS )rŽ   c             C   s   || _ || _d S )N)r^   r]   )r   r^   r]   r   r   r   rf   8  s    zDummyGetSetProperty.__set__N)r   r   r   rf   r   r   r   r   rŽ   7  s   rŽ   c               @   s   e Zd Zdd„ ZdS )r   c             C   s
   || _ d S )N)r^   )r   r^   r   r   r   rl   =  s    z$DummyGetSetDeleteProperty.__delete__N)r   r   r   rl   r   r   r   r   r   <  s   r   c               @   s   e Zd ZdS )r;   N)r   r   r   r   r   r   r   r;   @  s   r;   c               C   s   t dƒ tjd S )Nzzope.deprecation.tests)Ú
__import__r€   r   r   r   r   r   r4   E  s    r4   c               @   s   e Zd Zdd„ Zdd„ ZdS )r'   c             C   s
   d| _ d S )NT)r   )r   r   r   r   r¤   J  s    zDummyShow.__init__c             C   s   | j r
dS dS )NTF)r   )r   r   r   r   Ú__call__M  s    zDummyShow.__call__N)r   r   r   r¤   r¨   r   r   r   r   r'   I  s   r'   c               @   s   e Zd ZdS )r1   N)r   r   r   r   r   r   r   r1   R  s    r1   c               @   s   e Zd ZdS )r=   N)r   r   r   r   r   r   r   r=   T  s    r=   c               C   s   d S )Nr   r   r   r   r   r‰   V  ó    r‰   )r€   r@   ZunittestZTestCaser   r   Úobjectr!   r+   rR   r[   rd   rj   rp   r}   r“   r˜   r    r&   rŒ   rŽ   r   r7   r;   r_   r4   r'   r1   r=   r‰   r   r   r   r   Ú<module>   s4   ,[S($#V$"	