diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-08-09 13:40:59 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-08-09 13:40:59 -0400 |
commit | 0849ad447de8a1628e6b0158a5ce9b45d93f9bb8 (patch) | |
tree | 1e14289cac6e1aa51795e4e9fc49dac84c56cbe6 /tests/unittests/test__init__.py | |
parent | 77b5046f14b2535fd8c48dcbce25ef8e622926f5 (diff) | |
download | vyos-cloud-init-0849ad447de8a1628e6b0158a5ce9b45d93f9bb8.tar.gz vyos-cloud-init-0849ad447de8a1628e6b0158a5ce9b45d93f9bb8.zip |
stright forward pylint cleanups to tests/ and tools/
Diffstat (limited to 'tests/unittests/test__init__.py')
-rw-r--r-- | tests/unittests/test__init__.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/unittests/test__init__.py b/tests/unittests/test__init__.py index af18955d..464c8c2f 100644 --- a/tests/unittests/test__init__.py +++ b/tests/unittests/test__init__.py @@ -50,12 +50,14 @@ class TestWalkerHandleHandler(MockerTestCase): self.payload = "dummy payload" # Mock the write_file function - write_file_mock = self.mocker.replace(util.write_file, passthrough=False) + write_file_mock = self.mocker.replace(util.write_file, + passthrough=False) write_file_mock(expected_file_fullname, self.payload, 0600) def test_no_errors(self): """Payload gets written to file and added to C{pdata}.""" - import_mock = self.mocker.replace(importer.import_module, passthrough=False) + import_mock = self.mocker.replace(importer.import_module, + passthrough=False) import_mock(self.expected_module_name) self.mocker.result(self.module_fake) self.mocker.replay() @@ -67,7 +69,8 @@ class TestWalkerHandleHandler(MockerTestCase): def test_import_error(self): """Module import errors are logged. No handler added to C{pdata}""" - import_mock = self.mocker.replace(importer.import_module, passthrough=False) + import_mock = self.mocker.replace(importer.import_module, + passthrough=False) import_mock(self.expected_module_name) self.mocker.throw(ImportError()) self.mocker.replay() @@ -79,7 +82,8 @@ class TestWalkerHandleHandler(MockerTestCase): def test_attribute_error(self): """Attribute errors are logged. No handler added to C{pdata}""" - import_mock = self.mocker.replace(importer.import_module, passthrough=False) + import_mock = self.mocker.replace(importer.import_module, + passthrough=False) import_mock(self.expected_module_name) self.mocker.result(self.module_fake) self.mocker.throw(AttributeError()) @@ -185,13 +189,15 @@ class TestCmdlineUrl(MockerTestCase): payload = "0" cmdline = "ro %s=%s bar=1" % (key, url) - mock_readurl = self.mocker.replace(url_helper.readurl, passthrough=False) + mock_readurl = self.mocker.replace(url_helper.readurl, + passthrough=False) mock_readurl(url) self.mocker.result(url_helper.UrlResponse(200, payload)) self.mocker.replay() self.assertEqual((key, url, None), - util.get_cmdline_url(names=[key], starts="xxxxxx", cmdline=cmdline)) + util.get_cmdline_url(names=[key], starts="xxxxxx", + cmdline=cmdline)) def test_valid_content(self): url = "http://example.com/foo" @@ -199,7 +205,8 @@ class TestCmdlineUrl(MockerTestCase): payload = "xcloud-config\nmydata: foo\nbar: wark\n" cmdline = "ro %s=%s bar=1" % (key, url) - mock_readurl = self.mocker.replace(url_helper.readurl, passthrough=False) + mock_readurl = self.mocker.replace(url_helper.readurl, + passthrough=False) mock_readurl(url) self.mocker.result(url_helper.UrlResponse(200, payload)) self.mocker.replay() |