summaryrefslogtreecommitdiff
path: root/tests/unittests/helpers.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-02-07 12:08:30 -0500
committerScott Moser <smoser@ubuntu.com>2013-02-07 12:08:30 -0500
commita0f882fdd306ef7b3b90c53d5622eb5a6878cb81 (patch)
treeb317d68d593f74e7f4211513e7deba6f0ca61e1f /tests/unittests/helpers.py
parent88a369c5324e74a2d1bb8dd0bdf8fdc9a95393c8 (diff)
downloadvyos-cloud-init-a0f882fdd306ef7b3b90c53d5622eb5a6878cb81.tar.gz
vyos-cloud-init-a0f882fdd306ef7b3b90c53d5622eb5a6878cb81.zip
more test cases for nocloud including one for config seed
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()