a
    ¦ˆc¥  ã                   @   sF   d Z ddlZddlmZmZmZ G dd„ deƒZG dd„ dejƒZdS )z%
Tests for the ReadOnly trait type.

é    N)Ú	HasTraitsÚReadOnlyÚ
TraitErrorc                       s&   e Zd ZdZeƒ Z‡ fdd„Z‡  ZS )ÚObjectWithReadOnlyTextzf A dummy object that set the readonly trait in __init__

    There exists such usage in TraitsUI.
    c                    s    || _ tt| ƒjf i |¤Ž d S )N)ÚtextÚsuperr   Ú__init__)Úselfr   Ztraits©Ú	__class__© ú]/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/traits/tests/test_readonly.pyr       s    zObjectWithReadOnlyText.__init__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ú__classcell__r   r   r
   r   r      s   r   c                   @   s   e Zd ZdZdd„ ZdS )ÚTestReadOnlyTraitz Test ReadOnly TraitType. c                 C   sZ   t dd�}|  |jd¡ |  t¡� d|_W d   ƒ n1 s>0    Y  |  |jd¡ d S )NÚABC)r   ZXYZ)r   ÚassertEqualr   ÚassertRaisesr   )r	   Úobjr   r   r   Útest_set_readonly_trait_in_init(   s
    
$z1TestReadOnlyTrait.test_set_readonly_trait_in_initN)r   r   r   r   r   r   r   r   r   r   %   s   r   )	r   ZunittestZ
traits.apir   r   r   r   ZTestCaser   r   r   r   r   Ú<module>   s   