summaryrefslogtreecommitdiff
path: root/tests/unittests/test__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/test__init__.py')
-rw-r--r--tests/unittests/test__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unittests/test__init__.py b/tests/unittests/test__init__.py
index 1a307e56..c32783a6 100644
--- a/tests/unittests/test__init__.py
+++ b/tests/unittests/test__init__.py
@@ -181,7 +181,7 @@ class TestCmdlineUrl(unittest.TestCase):
def test_invalid_content(self):
url = "http://example.com/foo"
key = "mykey"
- payload = "0"
+ payload = b"0"
cmdline = "ro %s=%s bar=1" % (key, url)
with mock.patch('cloudinit.url_helper.readurl',
@@ -194,13 +194,13 @@ class TestCmdlineUrl(unittest.TestCase):
def test_valid_content(self):
url = "http://example.com/foo"
key = "mykey"
- payload = "xcloud-config\nmydata: foo\nbar: wark\n"
+ payload = b"xcloud-config\nmydata: foo\nbar: wark\n"
cmdline = "ro %s=%s bar=1" % (key, url)
with mock.patch('cloudinit.url_helper.readurl',
return_value=url_helper.StringResponse(payload)):
self.assertEqual(
- util.get_cmdline_url(names=[key], starts="xcloud-config",
+ util.get_cmdline_url(names=[key], starts=b"xcloud-config",
cmdline=cmdline),
(key, url, payload))
@@ -210,7 +210,7 @@ class TestCmdlineUrl(unittest.TestCase):
cmdline = "ro %s=%s bar=1" % (key, url)
with mock.patch('cloudinit.url_helper.readurl',
- return_value=url_helper.StringResponse('')):
+ return_value=url_helper.StringResponse(b'')):
self.assertEqual(
util.get_cmdline_url(names=["does-not-appear"],
starts="#cloud-config", cmdline=cmdline),