diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-03-19 08:22:30 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-03-19 08:22:30 -0400 |
commit | a904de054f7818137c864e0f3ff728b3764cf457 (patch) | |
tree | e28f4807469f2c39554d4353bf11685c03a1b4aa /tests/unittests/test__init__.py | |
parent | 204e79b93c882e17df63b24f7f682c0dbefb482d (diff) | |
parent | ae0f94c8f39a234d73ab8e2caf24d73439c8b5ee (diff) | |
download | vyos-cloud-init-a904de054f7818137c864e0f3ff728b3764cf457.tar.gz vyos-cloud-init-a904de054f7818137c864e0f3ff728b3764cf457.zip |
merge from trunk at revno 799
Diffstat (limited to 'tests/unittests/test__init__.py')
-rw-r--r-- | tests/unittests/test__init__.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/tests/unittests/test__init__.py b/tests/unittests/test__init__.py index d707afa9..b4b20e51 100644 --- a/tests/unittests/test__init__.py +++ b/tests/unittests/test__init__.py @@ -22,7 +22,8 @@ class FakeModule(handlers.Handler): def list_types(self): return self.types - def _handle_part(self, data, ctype, filename, payload, frequency): + def handle_part(self, _data, ctype, filename, # pylint: disable=W0221 + payload, frequency): pass @@ -103,6 +104,9 @@ class TestHandlerHandlePart(MockerTestCase): self.filename = "fake filename" self.payload = "fake payload" self.frequency = settings.PER_INSTANCE + self.headers = { + 'Content-Type': self.ctype, + } def test_normal_version_1(self): """ @@ -118,8 +122,8 @@ class TestHandlerHandlePart(MockerTestCase): self.payload) self.mocker.replay() - handlers.run_part(mod_mock, self.data, self.ctype, self.filename, - self.payload, self.frequency) + handlers.run_part(mod_mock, self.data, self.filename, + self.payload, self.frequency, self.headers) def test_normal_version_2(self): """ @@ -135,8 +139,8 @@ class TestHandlerHandlePart(MockerTestCase): self.payload, self.frequency) self.mocker.replay() - handlers.run_part(mod_mock, self.data, self.ctype, self.filename, - self.payload, self.frequency) + handlers.run_part(mod_mock, self.data, self.filename, + self.payload, self.frequency, self.headers) def test_modfreq_per_always(self): """ @@ -152,8 +156,8 @@ class TestHandlerHandlePart(MockerTestCase): self.payload) self.mocker.replay() - handlers.run_part(mod_mock, self.data, self.ctype, self.filename, - self.payload, self.frequency) + handlers.run_part(mod_mock, self.data, self.filename, + self.payload, self.frequency, self.headers) def test_no_handle_when_modfreq_once(self): """C{handle_part} is not called if frequency is once.""" @@ -163,8 +167,8 @@ class TestHandlerHandlePart(MockerTestCase): self.mocker.result(settings.PER_ONCE) self.mocker.replay() - handlers.run_part(mod_mock, self.data, self.ctype, self.filename, - self.payload, self.frequency) + handlers.run_part(mod_mock, self.data, self.filename, + self.payload, self.frequency, self.headers) def test_exception_is_caught(self): """Exceptions within C{handle_part} are caught and logged.""" @@ -178,8 +182,8 @@ class TestHandlerHandlePart(MockerTestCase): self.mocker.throw(Exception()) self.mocker.replay() - handlers.run_part(mod_mock, self.data, self.ctype, self.filename, - self.payload, self.frequency) + handlers.run_part(mod_mock, self.data, self.filename, + self.payload, self.frequency, self.headers) class TestCmdlineUrl(MockerTestCase): |