1 from os.path import realpath, join, dirname
6 def get_fixture_dir(dir_name):
7 """Returns path to fixtures directory dir_name."""
8 return realpath(join(dirname(__file__), 'files', dir_name))
11 def get_fixture(dir_name, file_name):
12 """Returns path to fixture file_name in directory dir_name."""
13 return join(get_fixture_dir(dir_name), file_name)
16 def get_all_fixtures(dir_name, glob_pattern='*'):
17 """Returns list of paths for fixtures in directory dir_name matching the glob_pattern."""
18 return [get_fixture(dir_name, file_name) for file_name in glob.glob(join(get_fixture_dir(dir_name), glob_pattern))]
21 def remove_output_file(dir_name, file_name):
23 os.remove(get_fixture(dir_name, file_name))