def test_config_filename_does_not_exist(): with pytest.raises(ValueError): PearlEnvironment._get_config_filename(Path('/myhome2/pearl.conf'), True)
def test_config_filename_not_a_file(tmp_path): with pytest.raises(ValueError): PearlEnvironment._get_config_filename(tmp_path, True)
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']))