diff options
author | Mike Milner <mike.milner@canonical.com> | 2012-02-21 15:43:53 -0400 |
---|---|---|
committer | Mike Milner <mike.milner@canonical.com> | 2012-02-21 15:43:53 -0400 |
commit | f54e9394e9d9dd0496d8084f9ca9ff5abee5f41c (patch) | |
tree | 60c76949ad93edb4680cfa0b58cb17190e164f43 /tests | |
parent | e8a3e39c1a6356460418d45f5b24f29b3fe6f20b (diff) | |
download | vyos-cloud-init-f54e9394e9d9dd0496d8084f9ca9ff5abee5f41c.tar.gz vyos-cloud-init-f54e9394e9d9dd0496d8084f9ca9ff5abee5f41c.zip |
Cleanups.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/test__init__.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/unittests/test__init__.py b/tests/unittests/test__init__.py index d273748a..e157fa77 100644 --- a/tests/unittests/test__init__.py +++ b/tests/unittests/test__init__.py @@ -49,7 +49,7 @@ class TestPartwalkerHandleHandler(MockerTestCase): self.assertEqual(1, self.data["handlercount"]) def test_import_error(self): - """Payload gets written to file and added to C{pdata}.""" + """Module import errors are logged. No handler added to C{pdata}""" # Mock the __import__ builtin import_mock = self.mocker.replace("__builtin__.__import__") import_mock(self.expected_module_name) @@ -67,8 +67,10 @@ class TestPartwalkerHandleHandler(MockerTestCase): partwalker_handle_handler(self.data, self.ctype, self.filename, self.payload) + self.assertEqual(0, self.data["handlercount"]) + def test_attribute_error(self): - """Payload gets written to file and added to C{pdata}.""" + """Attribute errors are logged. No handler added to C{pdata}""" # Mock the __import__ builtin import_mock = self.mocker.replace("__builtin__.__import__") import_mock(self.expected_module_name) @@ -92,6 +94,8 @@ class TestPartwalkerHandleHandler(MockerTestCase): partwalker_handle_handler(self.data, self.ctype, self.filename, self.payload) + self.assertEqual(0, self.data["handlercount"]) + class TestHandlerHandlePart(MockerTestCase): def setUp(self): @@ -147,9 +151,9 @@ class TestHandlerHandlePart(MockerTestCase): getattr(mod_mock, "frequency") self.mocker.result("always") getattr(mod_mock, "handler_version") - self.mocker.result(2) + self.mocker.result(1) mod_mock.handle_part(self.data, self.ctype, self.filename, - self.payload, self.frequency) + self.payload) self.mocker.replay() handler_handle_part(mod_mock, self.data, self.ctype, self.filename, |