diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-08-10 09:06:15 -0600 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-08-10 09:06:15 -0600 |
commit | c3c3dc693c14175e110b5fe125d4d5f98ace9700 (patch) | |
tree | 8858702c2c8a6ad4bf1bb861a4565e0a9c28e588 /tests/unittests/test_pathprefix2dict.py | |
parent | 5bd3493d732e5b1902872958e8681f17cbc81ce5 (diff) | |
download | cloud-init-trunk.tar.gz |
cloud-init development has moved its revision control to git.
It is available at
https://code.launchpad.net/cloud-init
Clone with
git clone https://git.launchpad.net/cloud-init
or
git clone git+ssh://git.launchpad.net/cloud-init
For more information see
https://git.launchpad.net/cloud-init/tree/HACKING.rst
Diffstat (limited to 'tests/unittests/test_pathprefix2dict.py')
-rw-r--r-- | tests/unittests/test_pathprefix2dict.py | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/tests/unittests/test_pathprefix2dict.py b/tests/unittests/test_pathprefix2dict.py deleted file mode 100644 index 38fd75b6..00000000 --- a/tests/unittests/test_pathprefix2dict.py +++ /dev/null @@ -1,44 +0,0 @@ -from cloudinit import util - -from .helpers import TestCase, populate_dir - -import shutil -import tempfile - - -class TestPathPrefix2Dict(TestCase): - - def setUp(self): - super(TestPathPrefix2Dict, self).setUp() - self.tmp = tempfile.mkdtemp() - self.addCleanup(shutil.rmtree, self.tmp) - - def test_required_only(self): - dirdata = {'f1': b'f1content', 'f2': b'f2content'} - populate_dir(self.tmp, dirdata) - - ret = util.pathprefix2dict(self.tmp, required=['f1', 'f2']) - self.assertEqual(dirdata, ret) - - def test_required_missing(self): - dirdata = {'f1': b'f1content'} - populate_dir(self.tmp, dirdata) - kwargs = {'required': ['f1', 'f2']} - self.assertRaises(ValueError, util.pathprefix2dict, self.tmp, **kwargs) - - def test_no_required_and_optional(self): - dirdata = {'f1': b'f1c', 'f2': b'f2c'} - populate_dir(self.tmp, dirdata) - - ret = util.pathprefix2dict(self.tmp, required=None, - optional=['f1', 'f2']) - self.assertEqual(dirdata, ret) - - def test_required_and_optional(self): - dirdata = {'f1': b'f1c', 'f2': b'f2c'} - populate_dir(self.tmp, dirdata) - - ret = util.pathprefix2dict(self.tmp, required=['f1'], optional=['f2']) - self.assertEqual(dirdata, ret) - -# vi: ts=4 expandtab |