summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2015-01-26 15:09:48 -0500
committerBarry Warsaw <barry@python.org>2015-01-26 15:09:48 -0500
commitf5d6d0e6433f12d05676bea03f78d57966c35b0a (patch)
treecd7ea47bf86cdeed4ebd22d988f428e8ad135300
parent18b35de06432869a9d859e2978e7e9567eba66a2 (diff)
downloadvyos-cloud-init-f5d6d0e6433f12d05676bea03f78d57966c35b0a.tar.gz
vyos-cloud-init-f5d6d0e6433f12d05676bea03f78d57966c35b0a.zip
Down to it.
-rw-r--r--tests/unittests/test_handler/test_handler_seed_random.py10
-rw-r--r--tests/unittests/test_util.py2
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/unittests/test_handler/test_handler_seed_random.py b/tests/unittests/test_handler/test_handler_seed_random.py
index c2da5ced..d3f18fa0 100644
--- a/tests/unittests/test_handler/test_handler_seed_random.py
+++ b/tests/unittests/test_handler/test_handler_seed_random.py
@@ -22,7 +22,7 @@ import base64
import gzip
import tempfile
-from six import StringIO
+from six import BytesIO
from cloudinit import cloud
from cloudinit import distros
@@ -76,7 +76,7 @@ class TestRandomSeed(t_help.TestCase):
return
def _compress(self, text):
- contents = StringIO()
+ contents = BytesIO()
gz_fh = gzip.GzipFile(mode='wb', fileobj=contents)
gz_fh.write(text)
gz_fh.close()
@@ -103,7 +103,7 @@ class TestRandomSeed(t_help.TestCase):
self.assertEquals("tiny-tim-was-here", contents)
def test_append_random_unknown_encoding(self):
- data = self._compress("tiny-toe")
+ data = self._compress(b"tiny-toe")
cfg = {
'random_seed': {
'file': self._seed_file,
@@ -115,7 +115,7 @@ class TestRandomSeed(t_help.TestCase):
self._get_cloud('ubuntu'), LOG, [])
def test_append_random_gzip(self):
- data = self._compress("tiny-toe")
+ data = self._compress(b"tiny-toe")
cfg = {
'random_seed': {
'file': self._seed_file,
@@ -128,7 +128,7 @@ class TestRandomSeed(t_help.TestCase):
self.assertEquals("tiny-toe", contents)
def test_append_random_gz(self):
- data = self._compress("big-toe")
+ data = self._compress(b"big-toe")
cfg = {
'random_seed': {
'file': self._seed_file,
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py
index b0207ace..f537d332 100644
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -166,7 +166,7 @@ class TestDeleteDirContents(unittest.TestCase):
def test_deletes_files(self):
"""Single file should be deleted."""
with open(os.path.join(self.tmp, "new_file.txt"), "wb") as f:
- f.write("DELETE ME")
+ f.write(b"DELETE ME")
util.delete_dir_contents(self.tmp)