summaryrefslogtreecommitdiff
path: root/tests/unittests/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/helpers.py')
-rw-r--r--tests/unittests/helpers.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unittests/helpers.py b/tests/unittests/helpers.py
index 4258a29d..91a50e18 100644
--- a/tests/unittests/helpers.py
+++ b/tests/unittests/helpers.py
@@ -182,3 +182,10 @@ class FilesystemMockingTestCase(ResourceUsingTestCase):
trap_func = retarget_many_wrapper(new_root, 1, func)
setattr(mod, f, trap_func)
self.patched_funcs.append((mod, f, func))
+
+def populate_dir(path, files):
+ os.makedirs(path)
+ for (name, content) in files.iteritems():
+ with open(os.path.join(path, name), "w") as fp:
+ fp.write(content)
+ fp.close()