def test_values_basedir_infinite_loop_2(fixtures_dir): start = os.getcwd() os.chdir(str(fixtures_dir)) try: Values.from_files("./values_data") finally: os.chdir(start)
def test_values(fixtures_dir): v = Values.from_files(fixtures_dir / 'values_data' / 'top' / 'bottom') expected = { 'shared': 'set at bottom', 'bottom_only': 'set at bottom', 'top_only': 'set at top' } assert expected == v.values
def test_values_inexistent_basedir(fixtures_dir): with pytest.raises(FileNotFoundError): Values.from_files(fixtures_dir / 'values_data' / 'top' / 'does-not-exist')
def test_values_basedir_infinite_loop_1(): Values.from_files(".")