示例#1
0
def test_relative(tmpdir):
    conf = tmpdir.join("test.yml")
    conf.write("")
    os.chdir(conf.dirname)
    assert _find_file("test.yml") == str(conf)
示例#2
0
def test_abspath(tmpdir):
    conf = tmpdir.join("test.yml")
    conf.write("")
    path = _find_file(str(conf))
    assert path == str(conf)
示例#3
0
def test_missing_strict(tmpdir):
    conf = tmpdir.join("test.yml")
    with pytest.raises(FileNotFoundError):
        _find_file(str(conf))
示例#4
0
def test_missing(tmpdir):
    conf = tmpdir.join("test.yml")
    assert _find_file(str(conf), require=False) is None
示例#5
0
def test_relative(tmpdir):
    conf = tmpdir.join('test.yml')
    conf.write('')
    os.chdir(conf.dirname)
    assert _find_file('test.yml') == str(conf)
示例#6
0
def test_abspath(tmpdir):
    conf = tmpdir.join('test.yml')
    conf.write('')
    path = _find_file(str(conf))
    assert path == str(conf)