def test_relative(tmpdir): conf = tmpdir.join("test.yml") conf.write("") os.chdir(conf.dirname) assert _find_file("test.yml") == str(conf)
def test_abspath(tmpdir): conf = tmpdir.join("test.yml") conf.write("") path = _find_file(str(conf)) assert path == str(conf)
def test_missing_strict(tmpdir): conf = tmpdir.join("test.yml") with pytest.raises(FileNotFoundError): _find_file(str(conf))
def test_missing(tmpdir): conf = tmpdir.join("test.yml") assert _find_file(str(conf), require=False) is None
def test_relative(tmpdir): conf = tmpdir.join('test.yml') conf.write('') os.chdir(conf.dirname) assert _find_file('test.yml') == str(conf)
def test_abspath(tmpdir): conf = tmpdir.join('test.yml') conf.write('') path = _find_file(str(conf)) assert path == str(conf)