← Back
Editing: test_profile.cpython-311.pyc
� �@�c� � � � d Z ddlZddlZddlZddlmZ ddlmZ ddlmZ ddl m Z mZ ddlm Z ddlmZ dd lmZ dd lmZ e ej � � � � Zedz Zedz Zd � Zd� Z G d� de� � Zd� Zd� Zd� ZdS )a Tests for profile-related functions. Currently only the startup-dir functionality is tested, but more tests should be added for: * ipython profile create * ipython profile list * ipython profile create --parallel * security dir permissions Authors ------- * MinRK � N)�Path)�TestCase)�TemporaryDirectory)�list_bundled_profiles�list_profiles_in)� ProfileDir)� decorators)�tools)� getoutput� home_test_dirz.ipythonc �d � t j � � t z � d�� � dS )zSSetup test environment for the module: - Adds dummy home dir tree T��parentsN)r �cwd�IP_TEST_DIR�mkdir� � �A/usr/lib/python3/dist-packages/IPython/core/tests/test_profile.py�setup_moduler 0 s, � � �X�Z�Z�+��$�$�T�$�2�2�2�2�2r c �8 � t j t � � dS )zXTeardown test environment for the module: - Remove dummy home dir tree N)�shutil�rmtree�TMP_TEST_DIRr r r �teardown_moduler : s � � �M�,�����r c �2 � e Zd Zd� Zd� Zd� Zd� Zd� Zd� ZdS )�ProfileStartupTestc � � t j t d� � | _ dt ddg| _ t dz | _ d S )N�testz --ipython-dirz --profileztest.py)r �create_profile_dir_by_namer �pd�optionsr �fname��selfs r �setUpzProfileStartupTest.setUpI s6 � ��7��V�L�L���'��k�6�J���!�I�-�� � � r c �B � t j | j j � � d S �N)r r r! �locationr$ s r �tearDownzProfileStartupTest.tearDownO s � � � �d�g�&�'�'�'�'�'r c �B � t t | j j � � |z dd�� � 5 }|� |� � d d d � � n# 1 swxY w Y t | j dd�� � 5 }|� |� � d d d � � d S # 1 swxY w Y d S )N�w�utf-8��encoding)�openr r! �startup_dir�writer# )r% �startup_file�startupr �fs r �initzProfileStartupTest.initT s � � �$�t�w�*�+�+�l�:�C�'� R� R� R� �VW� �G�G�G���� � � � � � � � � � � ���� � � � � �$�*�c�G� 4� 4� 4� �� �G�G�D�M�M�M� � � � � � � � � � � � ���� � � � � � s# �A�A�A�1B�B�Bc �J � t j | j |d| j �� � d S )N� )r"