diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-02-07 12:08:30 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-02-07 12:08:30 -0500 |
commit | a0f882fdd306ef7b3b90c53d5622eb5a6878cb81 (patch) | |
tree | b317d68d593f74e7f4211513e7deba6f0ca61e1f /tests/unittests/helpers.py | |
parent | 88a369c5324e74a2d1bb8dd0bdf8fdc9a95393c8 (diff) | |
download | vyos-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.py | 7 |
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() |