summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-05-11 11:06:08 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-05-11 11:06:08 +0200
commit0a35ba5b8d85077a865a137887aa8cfd76405eb2 (patch)
tree202329dbefab485aba98263be469b64fe837e737
parent0e299c89e10a6ccb583588ff31ac783421e57501 (diff)
downloadvyos-cloud-init-0a35ba5b8d85077a865a137887aa8cfd76405eb2.tar.gz
vyos-cloud-init-0a35ba5b8d85077a865a137887aa8cfd76405eb2.zip
fix a few forgotten pep8 warnings in test_handler_apt_source.py
-rw-r--r--tests/unittests/test_handler/test_handler_apt_source.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/unittests/test_handler/test_handler_apt_source.py b/tests/unittests/test_handler/test_handler_apt_source.py
index e73a72c6..849f23c9 100644
--- a/tests/unittests/test_handler/test_handler_apt_source.py
+++ b/tests/unittests/test_handler/test_handler_apt_source.py
@@ -40,12 +40,14 @@ PACKAGE_MIRRORS = [
GAPMI = distros._get_arch_package_mirror_info
+
def load_tfile_or_url(*args, **kwargs):
""" load_tfile_or_url
load file and return content after decoding
"""
return util.decode_binary(util.read_file_or_url(*args, **kwargs).contents)
+
class TestAptSourceConfig(TestCase):
""" TestAptSourceConfig
Main Class to test apt_source configs
@@ -56,7 +58,6 @@ class TestAptSourceConfig(TestCase):
self.addCleanup(shutil.rmtree, self.tmp)
self.aptlistfile = os.path.join(self.tmp, "single-deb.list")
-
@staticmethod
def _get_default_params():
""" get_default_params
@@ -67,7 +68,6 @@ class TestAptSourceConfig(TestCase):
params['MIRROR'] = "http://archive.ubuntu.com/ubuntu"
return params
-
def test_apt_source_basic(self):
""" test_apt_source_basic
Test Fix deb source string, has to overwrite mirror conf in params
@@ -89,7 +89,6 @@ class TestAptSourceConfig(TestCase):
"main universe multiverse restricted"),
contents, flags=re.IGNORECASE))
-
def test_apt_source_replacement(self):
""" test_apt_source_replace
Test Autoreplacement of MIRROR and RELEASE in source specs
@@ -108,7 +107,6 @@ class TestAptSourceConfig(TestCase):
"multiverse"),
contents, flags=re.IGNORECASE))
-
def test_apt_source_key(self):
""" test_apt_source_key
Test specification of a source + key
@@ -121,7 +119,8 @@ class TestAptSourceConfig(TestCase):
'keyid': "03683F77",
'filename': self.aptlistfile}
- with mock.patch.object(util, 'subp', return_value=('fakekey 1234', '')) as mockobj:
+ with mock.patch.object(util, 'subp',
+ return_value=('fakekey 1234', '')) as mockobj:
cc_apt_configure.add_sources([cfg], params)
mockobj.assert_called_with(('apt-key', 'add', '-'), 'fakekey 1234')
@@ -136,7 +135,6 @@ class TestAptSourceConfig(TestCase):
"xenial", "main"),
contents, flags=re.IGNORECASE))
-
def test_apt_source_ppa(self):
""" test_apt_source_ppa
Test specification of a ppa
@@ -151,7 +149,7 @@ class TestAptSourceConfig(TestCase):
with mock.patch.object(util, 'subp') as mockobj:
cc_apt_configure.add_sources([cfg], params, aa_repo_match=matcher)
mockobj.assert_called_once_with(['add-apt-repository',
- 'ppa:smoser/cloud-init-test'])
+ 'ppa:smoser/cloud-init-test'])
# adding ppa should ignore filename (uses add-apt-repository)
self.assertFalse(os.path.isfile(self.aptlistfile))