Beispiel #1
0
def test_get_ini_file_path_script_raise(tmpdir, monkeypatch):
    monkeypatch.setattr('pathlib.Path.root', tmpdir)
    target = Path(tmpdir) / 'script.py'
    open(target, 'a').close()

    with pytest.raises(ValueError):
        get_ini_file_path(target.name)
Beispiel #2
0
def test_get_ini_file_path_raise(tmpdir, monkeypatch):
    monkeypatch.setattr('pathlib.Path.root', tmpdir)

    target_dir = tmpdir.mkdir('test').mkdir('test_again')
    with pytest.raises(ValueError):
        get_ini_file_path(target_dir)
Beispiel #3
0
def test_get_ini_file_path():
    conf_path = get_ini_file_path(__file__)

    assert conf_path == Path(__file__).parent / 'logme.ini'