File: //snap/core20/2599/usr/share/subiquity/subiquitycore/tests/__pycache__/test_netplan.cpython-38.pyc
U
K��^o � @ s8 d dl Z d dlmZmZ d dlmZ G dd� de�ZdS )� N)�SubiTestCase�populate_dir)�configs_in_rootc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�TestConfigsInRootc sR | � � � dddg}dg}t� dd� || D �� | �� fdd�|D �t� �� d S )
z<configs_in_root masked=False should not return masked files.�run/netplan/00base.yaml�lib/netplan/01system.yaml�etc/netplan/99end.yaml�etc/netplan/00base.yamlc S s i | ]
}|d �qS )z
key: here
� ��.0�fr
r
�8/usr/share/subiquity/subiquitycore/tests/test_netplan.py�
<dictcomp> s z6TestConfigsInRoot.test_masked_true.<locals>.<dictcomp>c s g | ]}t j�� |��qS r
��os�path�join�r �p�Zmy_dirr
r �
<listcomp> s z6TestConfigsInRoot.test_masked_true.<locals>.<listcomp>N�Ztmp_dirr ZassertEqualr )�selfZunmasked�maskedr
r r �test_masked_true s ��z"TestConfigsInRoot.test_masked_truec sN | � � � ddddg}t� dd� |D �� | �� fdd�|D �t� d d
�� dS )z4configs_in_root mask=True should return all configs.r r r r c S s i | ]
}|d �qS �zsomeyaml: here
r
r r
r
r r s z7TestConfigsInRoot.test_masked_false.<locals>.<dictcomp>c s g | ]}t j�� |��qS r
r r r r
r r s z7TestConfigsInRoot.test_masked_false.<locals>.<listcomp>T)r Nr )r �yamlsr
r r �test_masked_false s �
�z#TestConfigsInRoot.test_masked_falsec sR | � � � ddg}ddg}t� dd� || D �� | �� fdd�|D �t� �� d S )
z0configs_in_root should only return *.yaml files.r r zetc/netplan/ignored.yaml.distzrun/netplan/my.cfgc S s i | ]
}|d �qS r r
r r
r
r r % s z=TestConfigsInRoot.test_only_includes_yaml.<locals>.<dictcomp>c s g | ]}t j�� |��qS r
r r r r
r r '