3
8ßL]1  ã               @   sz   d Z ddlmZ ddlZddlmZmZmZmZm	Z	 ddl
mZmZ G dd„ deƒZG dd	„ d	eƒZG d
d„ dejƒZdS )z2 General regression tests for various fixed bugs.
é    )Úabsolute_importN)ÚDelegatesToÚEventÚ	HasTraitsÚInstanceÚ	Undefined)ÚEditorÚ
TextEditorc               @   s   e Zd Zeƒ ZdS )ÚParentN)Ú__name__Ú
__module__Ú__qualname__r   Úbutton© r   r   úD/tmp/pip-install-5sebvq2j/traitsui/traitsui/tests/test_regression.pyr
      s   r
   c               @   s   e Zd ZeeƒZedƒZdS )ÚChildÚparentN)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 )ÚTestRegressionc             C   s0   t tƒ d�}tdtƒ |dd�}| j|jtƒ dS )zF Make sure that DelegatesTo on Events passes Editor creation.
        )r   Nr   )ÚfactoryÚobjectÚname)r   r
   r   r	   ZassertIsÚ	old_valuer   )ÚselfÚchildÚeditorr   r   r   Ú!test_editor_on_delegates_to_event!   s    z0TestRegression.test_editor_on_delegates_to_eventc             C   s   | j ttdtƒ tƒ dd� dS )zE Make sure genuine AttributeErrors raise on Editor creation.
        NZnot_a_trait)r   r   r   )ZassertRaisesÚAttributeErrorr   r	   r
   )r   r   r   r   Útest_attribute_error,   s    
z#TestRegression.test_attribute_errorN)r   r   r   r   r   r   r   r   r   r      s   r   )Ú__doc__Ú
__future__r   ZunittestZ
traits.apir   r   r   r   r   Ztraitsui.apir   r	   r
   r   ZTestCaser   r   r   r   r   Ú<module>   s   