summaryrefslogtreecommitdiff
path: root/tests/unittests/test__init__.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-08-09 13:42:55 -0400
committerScott Moser <smoser@ubuntu.com>2012-08-09 13:42:55 -0400
commit0243c5d9c7948e247a85870a24835e2f5ce92cb0 (patch)
treeb67c2911c07b013f893f1ac0c8428a99c9095628 /tests/unittests/test__init__.py
parent1bb67be5bd8c826717c9757f727406c73c7ef4e8 (diff)
parent0849ad447de8a1628e6b0158a5ce9b45d93f9bb8 (diff)
downloadvyos-cloud-init-0243c5d9c7948e247a85870a24835e2f5ce92cb0.tar.gz
vyos-cloud-init-0243c5d9c7948e247a85870a24835e2f5ce92cb0.zip
fix pylint in all files used by ./tools/run-pylint
'make pylint' was not checking tests and tools. This fixies a bunch of pylint/pep8 issues in that code. It also enables 'make pylint' to check them.
Diffstat (limited to 'tests/unittests/test__init__.py')
-rw-r--r--tests/unittests/test__init__.py21
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()