summaryrefslogtreecommitdiff
path: root/tests/unittests/test_util.py
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-01-21 18:02:42 -0500
committerChad Smith <chad.smith@canonical.com>2020-01-21 16:02:42 -0700
commitbb71a9d08d25193836eda91c328760305285574e (patch)
tree50a1f2f4a61e04255c5a8129e7a2a26d9d4cecd4 /tests/unittests/test_util.py
parent8c4fd886931abcf2cc8627a47463907d655b35c3 (diff)
downloadvyos-cloud-init-bb71a9d08d25193836eda91c328760305285574e.tar.gz
vyos-cloud-init-bb71a9d08d25193836eda91c328760305285574e.zip
Drop most of the remaining use of six (#179)
Diffstat (limited to 'tests/unittests/test_util.py')
-rw-r--r--tests/unittests/test_util.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py
index 0e71db82..75a3f0b4 100644
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -2,16 +2,15 @@
from __future__ import print_function
+import io
+import json
import logging
import os
import re
import shutil
import stat
-import tempfile
-
-import json
-import six
import sys
+import tempfile
import yaml
from cloudinit import importer, util
@@ -320,7 +319,7 @@ class TestLoadYaml(helpers.CiTestCase):
def test_python_unicode(self):
# complex type of python/unicode is explicitly allowed
- myobj = {'1': six.text_type("FOOBAR")}
+ myobj = {'1': "FOOBAR"}
safe_yaml = yaml.dump(myobj)
self.assertEqual(util.load_yaml(blob=safe_yaml,
default=self.mydefault),
@@ -663,8 +662,8 @@ class TestMultiLog(helpers.FilesystemMockingTestCase):
self.patchOS(self.root)
self.patchUtils(self.root)
self.patchOpen(self.root)
- self.stdout = six.StringIO()
- self.stderr = six.StringIO()
+ self.stdout = io.StringIO()
+ self.stderr = io.StringIO()
self.patchStdoutAndStderr(self.stdout, self.stderr)
def test_stderr_used_by_default(self):
@@ -879,8 +878,8 @@ class TestSubp(helpers.CiTestCase):
"""Raised exc should have stderr, stdout as string if no decode."""
with self.assertRaises(util.ProcessExecutionError) as cm:
util.subp([BOGUS_COMMAND], decode=True)
- self.assertTrue(isinstance(cm.exception.stdout, six.string_types))
- self.assertTrue(isinstance(cm.exception.stderr, six.string_types))
+ self.assertTrue(isinstance(cm.exception.stdout, str))
+ self.assertTrue(isinstance(cm.exception.stderr, str))
def test_bunch_of_slashes_in_path(self):
self.assertEqual("/target/my/path/",