Index: tests/utils.py |
=================================================================== |
--- a/tests/utils.py |
+++ b/tests/utils.py |
@@ -29,15 +29,23 @@ |
) |
-def get_dir_contents(path): |
+def get_dir_contents(path, test_type=False): |
# TODO: This function is duplicated in test_page_outputs.py. |
dirdata = {} |
for dirpath, dirnames, filenames in os.walk(path): |
for output_file in filenames: |
filepath = os.path.join(dirpath, output_file) |
with open(filepath) as f: |
- locale = os.path.split(os.path.split(filepath)[0])[1] |
- dirdata[os.path.join(locale, output_file)] = f.read().strip() |
+ if test_type: |
+ locale = os.path.split(os.path.split(os.path.split |
+ (filepath)[0])[0])[1] |
+ test_type = os.path.split(os.path.split(filepath)[0])[1] |
+ dirdata[os.path.join(locale, test_type, |
+ output_file)] = f.read().strip() |
+ else: |
+ locale = os.path.split(os.path.split(filepath)[0])[1] |
+ dirdata[os.path.join(locale, |
+ output_file)] = f.read().strip() |
return dirdata |