a
    ©ˆc   ã                   @   sr   d dl Z d dlZd dlmZ d dlmZ d dlmZ zd dl	m
Z
 W n eyZ   dZ
Y n0 G dd„ de jƒZdS )é    N)Ú
CorePlugin)ÚPythonShellPlugin)ÚTasksPlugin)ÚIPythonKernelPluginc                   @   s<   e Zd Zdd„ Zdd„ Ze edu d¡dd„ ƒZd	d
„ Z	dS )ÚTestIdsc                 C   s.   g d¢}|D ]}t tj|ƒ}|  |t¡ qd S )N)
ÚPREFERENCESÚSERVICE_OFFERSÚBINDINGSÚCOMMANDSÚIPYTHON_NAMESPACEÚPREFERENCES_CATEGORIESÚPREFERENCES_PANESÚTASKSÚTASK_EXTENSIONSÚIPYTHON_KERNEL_PROTOCOL)ÚgetattrÚenvisageÚidsZassertIsInstanceÚstr)ÚselfZextension_point_idsZextension_point_idZid_value© r   úZ/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/envisage/tests/test_ids.pyÚtest_id_strings   s    zTestIds.test_id_stringsc                 C   sd   |   dt¡ |   dt¡ |   dt¡ |   dt¡ |   dt¡ |   dt¡ |   dt¡ |   dt¡ d S )	Nr   r   r	   r
   r   r   r   r   )Úcheck_id_against_pluginr   r   r   ©r   r   r   r   Ú(test_id_strings_against_plugin_constants.   s    z0TestIds.test_id_strings_against_plugin_constantsNz,skipping tests that require IPython packagesc                 C   s   |   dt¡ |   dt¡ d S )Nr   r   )r   r   r   r   r   r   Ú2test_id_strings_against_plugin_constants_ipykernel9   s    ÿz:TestIds.test_id_strings_against_plugin_constants_ipykernelc                 C   s   |   ttj|ƒt||ƒ¡ dS )a   
        Check that the value of an id string matches that of a class variable.

        Parameters
        ----------
        id_string : str
            Identifier for the id.
        plugin_klass : type
            The Plugin subclass to check.
        N)ÚassertEqualr   r   r   )r   Z	id_stringZplugin_klassr   r   r   r   E   s    
þzTestIds.check_id_against_plugin)
Ú__name__Ú
__module__Ú__qualname__r   r   ÚunittestZskipIfr   r   r   r   r   r   r   r      s   þ
r   )r!   Zenvisage.idsr   Zenvisage.apir   Z1envisage.plugins.python_shell.python_shell_pluginr   Zenvisage.ui.tasks.apir   Z#envisage.plugins.ipython_kernel.apir   ÚImportErrorZTestCaser   r   r   r   r   Ú<module>   s   
