a
    ¦ˆc·  ã                   @   s>   d Z ddlZddlmZ G dd„ deƒZG dd„ dejƒZdS )z> Tests for regular Python properties in a HasTraits subclass. é    N)Ú	HasTraitsc                       sB   e Zd Z‡ fdd„Zedd„ ƒZedd„ ƒZejdd„ ƒZ‡  ZS )ÚModelc                    s   t ƒ  ¡  d| _d S )Nr   )ÚsuperÚ__init__Ú_value©Úself©Ú	__class__© úf/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/traits/tests/test_python_properties.pyr      s    
zModel.__init__c                 C   s   dS )NéÁ  r   r   r   r   r   Ú	read_only   s    zModel.read_onlyc                 C   s   | j S ©N©r   r   r   r   r   Úvalue   s    zModel.valuec                 C   s
   || _ d S r   r   )r   Únewr   r   r   r      s    )	Ú__name__Ú
__module__Ú__qualname__r   Úpropertyr   r   ÚsetterÚ__classcell__r   r   r	   r   r      s   

r   c                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚTestPythonPropertyc                 C   sv   t ƒ }|  |jd¡ |  t¡� d|_W d   ƒ n1 s:0    Y  |  t¡� |`W d   ƒ n1 sh0    Y  d S )Nr   iò  )r   ÚassertEqualr   ÚassertRaisesÚAttributeError©r   Úmodelr   r   r   Útest_read_only_property%   s    $z*TestPythonProperty.test_read_only_propertyc                 C   sn   t ƒ }|  |jd¡ d|_|  |jd¡ d|_|  |jd¡ |  t¡� |`W d   ƒ n1 s`0    Y  d S )Nr   é   éM   )r   r   r   r   r   r   r   r   r   Útest_read_write_property/   s    z+TestPythonProperty.test_read_write_propertyN)r   r   r   r   r"   r   r   r   r   r   $   s   
r   )Ú__doc__ZunittestZ
traits.apir   r   ZTestCaser   r   r   r   r   Ú<module>   s   