a
    m b‚  ã                   @   sj   d dl Z d dlmZ d dlmZ e j d¡Ze jdd„ ƒZ	dZ
e jdd	„ ƒZd
Ze jdd„ ƒZdd„ ZdS )é    N)Újupyter_config_path)ÚExtensionConfigManagerZ
jp_environc                 C   s   |   d¡}| ¡  |S )zFA pathlib.Path object that acts like a jupyter_server_config.d folder.zjupyter_server_config.d)ÚjoinpathÚmkdir)Zjp_env_config_pathÚconfigd© r   úIlib/python3.9/site-packages/jupyter_server/tests/extension/test_config.pyr      s    
r   zh{
    "ServerApp": {
        "jpserver_extensions": {
            "ext1_config": true
        }
    }
}
c                 C   s   |   d¡}| t¡ d S )Nzext1_config.json)r   Ú
write_textÚext1_json_config©r   Zconfigr   r   r   Úext1_config!   s    
r   zi{
    "ServerApp": {
        "jpserver_extensions": {
            "ext2_config": false
        }
    }
}
c                 C   s   |   d¡}| t¡ d S )Nzext2_config.json)r   r	   Úext2_json_configr   r   r   r   Úext2_config2   s    
r   c                 C   s0   t tƒ d}| ¡ }d|v s J ‚d|v s,J ‚d S )N)Zread_config_pathr   r   )r   r   Zget_jpserver_extensions)r   r   ZmanagerÚ
extensionsr   r   r   Ú test_list_extension_from_configd8   s    r   )ZpytestZjupyter_core.pathsr   Zjupyter_server.extension.configr   ZmarkZusefixturesZ
pytestmarkZfixturer   r
   r   r   r   r   r   r   r   r   Ú<module>   s   


