diff options
Diffstat (limited to 'tests/unittests')
-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, |