%PDF- %PDF-
Direktori : /snap/core22/current/usr/share/subiquity/subiquitycore/tests/__pycache__/ |
Current File : //snap/core22/current/usr/share/subiquity/subiquitycore/tests/__pycache__/__init__.cpython-310.pyc |
o K��^^ � @ sH d dl Z d dlZd dlZd dlZd dlmZ G dd� de�Zdd� ZdS )� N)�TestCasec @ s e Zd Zddd�Zddd�ZdS ) �SubiTestCaseNTc C sB |d u rt jd| jj d�}nt j|d�}| �t�tj|�� |S )Nz subiquity-%s.)�prefix)�dir) �tempfile�mkdtemp� __class__�__name__� addCleanup� functools�partial�shutil�rmtree)�selfr �cleanup�tmpd� r �4/usr/share/subiquity/subiquitycore/tests/__init__.py�tmp_dir s �zSubiTestCase.tmp_dirc C s. |d u r| � � }tj�tj�tj�||���S �N)r �os�path�normpath�abspath�join)r r r r r r �tmp_path s zSubiTestCase.tmp_path)NTr )r � __module__�__qualname__r r r r r r r s r c C s� t j�| �st �| � g }|�� D ]Q\}}t jj�| |g�}t j�t j�|��s1t �t j�|�� t |d��}t |t�rB|�|� n|�|� d�� |�� W d � n1 sXw Y |�|� q|S )N�wbzutf-8)r r �exists�makedirs�items�sepr �isdir�dirname�open� isinstance�bytes�write�encode�close�append)r �files�ret�name�content�p�fpr r r �populate_dir s �r2 )r r r r �unittestr r r2 r r r r �<module> s