diff options
author | Joshua Harlow <harlowja@gmail.com> | 2016-05-12 14:25:32 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@gmail.com> | 2016-05-12 14:25:32 -0700 |
commit | 78cbc764486060928541b9dee6ce5779e622d1fa (patch) | |
tree | 48a886ea0a9857ce353eebe504048e656e1c6e92 /tests/unittests/test_handler/test_handler_set_hostname.py | |
parent | 690bdce9a73ec6d00b4eebbbca31cc527e7b2fce (diff) | |
parent | 811f7b5b3c4590ee4a16662db37b1f37541d9822 (diff) | |
download | vyos-cloud-init-78cbc764486060928541b9dee6ce5779e622d1fa.tar.gz vyos-cloud-init-78cbc764486060928541b9dee6ce5779e622d1fa.zip |
Enable flake8 and fix a large amount of reported issues
Diffstat (limited to 'tests/unittests/test_handler/test_handler_set_hostname.py')
-rw-r--r-- | tests/unittests/test_handler/test_handler_set_hostname.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/unittests/test_handler/test_handler_set_hostname.py b/tests/unittests/test_handler/test_handler_set_hostname.py index d358b069..7effa124 100644 --- a/tests/unittests/test_handler/test_handler_set_hostname.py +++ b/tests/unittests/test_handler/test_handler_set_hostname.py @@ -7,13 +7,11 @@ from cloudinit import util from .. import helpers as t_help -import shutil -import tempfile +from configobj import ConfigObj import logging - +import shutil from six import BytesIO - -from configobj import ConfigObj +import tempfile LOG = logging.getLogger(__name__) @@ -43,8 +41,8 @@ class TestHostname(t_help.FilesystemMockingTestCase): if not distro.uses_systemd(): contents = util.load_file("/etc/sysconfig/network", decode=False) n_cfg = ConfigObj(BytesIO(contents)) - self.assertEquals({'HOSTNAME': 'blah.blah.blah.yahoo.com'}, - dict(n_cfg)) + self.assertEqual({'HOSTNAME': 'blah.blah.blah.yahoo.com'}, + dict(n_cfg)) def test_write_hostname_debian(self): cfg = { @@ -58,7 +56,7 @@ class TestHostname(t_help.FilesystemMockingTestCase): cc_set_hostname.handle('cc_set_hostname', cfg, cc, LOG, []) contents = util.load_file("/etc/hostname") - self.assertEquals('blah', contents.strip()) + self.assertEqual('blah', contents.strip()) def test_write_hostname_sles(self): cfg = { @@ -71,4 +69,4 @@ class TestHostname(t_help.FilesystemMockingTestCase): self.patchUtils(self.tmp) cc_set_hostname.handle('cc_set_hostname', cfg, cc, LOG, []) contents = util.load_file("/etc/HOSTNAME") - self.assertEquals('blah', contents.strip()) + self.assertEqual('blah', contents.strip()) |