3
7ßL]õ  ã               @   s`   d dl mZmZmZmZ d dlmZ d dlmZm	Z	 d dl
mZ d dlmZ G dd„ deƒZdS )	é    )Úabsolute_importÚdivisionÚprint_functionÚunicode_literals)ÚUnittestTools)ÚActionÚMenuManager)ÚGUI)ÚWindowc               @   sH   e Zd 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S )Ú
FieldMixinz7 Mixin which provides standard methods for all fields. c             C   sR   t ƒ | _tƒ | _| jjƒ  | j| jƒ | jjƒ  | jƒ | _	| jj
ƒ  | jjƒ  d S )N)r	   Úguir
   ÚparentÚ_createÚ
addCleanupÚ_destroy_parentÚprocess_eventsÚ_create_widgetÚwidgetÚopen)Úself© r   úC/tmp/pip-install-5sebvq2j/pyface/pyface/fields/tests/field_mixin.pyÚsetUp   s    



zFieldMixin.setUpc             C   s
   t ƒ ‚d S )N)ÚNotImplementedError)r   r   r   r   r   %   s    zFieldMixin._create_widgetc             C   s0   | j jƒ  | j| jƒ | j jdƒ | jjƒ  d S )NT)r   r   r   Ú_destroy_widgetÚshowr   r   )r   r   r   r   Ú_create_widget_control(   s    
z!FieldMixin._create_widget_controlc             C   s   | j jƒ  | jjƒ  d | _ d S )N)r   Údestroyr   r   )r   r   r   r   r   .   s    

zFieldMixin._destroy_parentc             C   s   | j jƒ  | jjƒ  d | _ d S )N)r   r   r   r   )r   r   r   r   r   3   s    

zFieldMixin._destroy_widgetc             C   s0   | j ƒ  d| j_| jjƒ  | j| jjƒ dƒ d S )NzNew tooltip.)r   r   Ztooltipr   r   ZassertEqualZ_get_control_tooltip)r   r   r   r   Útest_field_tooltip:   s    
zFieldMixin.test_field_tooltipc             C   s,   | j ƒ  ttdd�dd�| j_| jjƒ  d S )NZTest)Úname)r   r   r   r   Úmenur   r   )r   r   r   r   Útest_field_menuA   s    zFieldMixin.test_field_menuN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r!   r   r   r   r   r      s   r   N)Ú
__future__r   r   r   r   Ztraits.testing.unittest_toolsr   Zpyface.action.apir   r   Z
pyface.guir	   Zpyface.windowr
   r   r   r   r   r   Ú<module>
   s
   