summaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2016-09-30 15:53:42 -0400
committerScott Moser <smoser@ubuntu.com>2016-10-19 20:02:56 -0400
commite8730078df8c99696b1b684e09c803eef7c4926c (patch)
treebd2d04720201ccc78df8a1afe531084913e1b059 /tests/unittests
parentf0747c4b4cf073273e11d383f0354257be7276ed (diff)
downloadvyos-cloud-init-e8730078df8c99696b1b684e09c803eef7c4926c.tar.gz
vyos-cloud-init-e8730078df8c99696b1b684e09c803eef7c4926c.zip
Fix python2.6 things found running in centos 6.
This gets the tests running in centos 6. * ProcessExecutionError: remove setting of .message Nothing in cloud-init seems to use .message anywhere, so it does not seem necessary. The reason to change it is that on 2.6 it spits out: cloudinit/util.py:286: DeprecationWarning: BaseException.message * tox.ini: add a centos6 environment the tox versions listed here replicate a centos6 install with packages from EPEL. You will still need a python2.6 to run this env so we do not enable it by default.
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/test_handler/test_handler_apt_conf_v1.py2
-rw-r--r--tests/unittests/test_util.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/unittests/test_handler/test_handler_apt_conf_v1.py b/tests/unittests/test_handler/test_handler_apt_conf_v1.py
index 45714efd..64acc3e0 100644
--- a/tests/unittests/test_handler/test_handler_apt_conf_v1.py
+++ b/tests/unittests/test_handler/test_handler_apt_conf_v1.py
@@ -118,7 +118,7 @@ class TestConversion(TestCase):
def test_convert_with_apt_mirror(self):
mirror = 'http://my.mirror/ubuntu'
f = cc_apt_configure.convert_to_v3_apt_format({'apt_mirror': mirror})
- self.assertIn(mirror, {m['uri'] for m in f['apt']['primary']})
+ self.assertIn(mirror, set(m['uri'] for m in f['apt']['primary']))
def test_no_old_content(self):
mirror = 'http://my.mirror/ubuntu'
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py
index fc6b9d40..881509aa 100644
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -553,7 +553,7 @@ class TestSubp(helpers.TestCase):
def test_subp_decode_invalid_utf8_replaces(self):
(out, _err) = util.subp(self.stdin2out, capture=True,
data=self.utf8_invalid)
- expected = self.utf8_invalid.decode('utf-8', errors='replace')
+ expected = self.utf8_invalid.decode('utf-8', 'replace')
self.assertEqual(out, expected)
def test_subp_decode_strict_raises(self):