Пример #1
0
def test_config_filename_does_not_exist():
    with pytest.raises(ValueError):
        PearlEnvironment._get_config_filename(Path('/myhome2/pearl.conf'),
                                              True)
Пример #2
0
def test_config_filename_not_a_file(tmp_path):
    with pytest.raises(ValueError):
        PearlEnvironment._get_config_filename(tmp_path, True)
Пример #3
0
def test_config_filename():
    assert PearlEnvironment._get_config_filename(
        Path('/myhome2/pearl.conf'), False) == Path('/myhome2/pearl.conf')
    assert PearlEnvironment._get_config_filename(None, False) == Path(
        '{}/.config/pearl/pearl.conf'.format(os.environ['HOME']))