summaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/test_datasource/test_azure.py6
-rw-r--r--tests/unittests/test_datasource/test_configdrive.py2
-rw-r--r--tests/unittests/test_datasource/test_openstack.py2
-rw-r--r--tests/unittests/test_datasource/test_scaleway.py22
-rw-r--r--tests/unittests/test_handler/test_handler_apt_source_v3.py2
-rw-r--r--tests/unittests/test_handler/test_handler_debug.py2
-rw-r--r--tests/unittests/test_util.py2
7 files changed, 19 insertions, 19 deletions
diff --git a/tests/unittests/test_datasource/test_azure.py b/tests/unittests/test_datasource/test_azure.py
index a4296bf6..d7206c72 100644
--- a/tests/unittests/test_datasource/test_azure.py
+++ b/tests/unittests/test_datasource/test_azure.py
@@ -912,13 +912,13 @@ scbus-1 on xpt0 bus 0
'PreprovisionedVMType': None,
'PreprovisionedVm': False,
'datasource': {'Azure': {'agent_command': 'my_command'}},
- 'system_info': {'default_user': {'name': u'myuser'}}}
+ 'system_info': {'default_user': {'name': 'myuser'}}}
expected_metadata = {
'azure_data': {
'configurationsettype': 'LinuxProvisioningConfiguration'},
'imds': NETWORK_METADATA,
'instance-id': EXAMPLE_UUID,
- 'local-hostname': u'myhost',
+ 'local-hostname': 'myhost',
'random_seed': 'wild'}
crawled_metadata = dsrc.crawl_metadata()
@@ -1385,7 +1385,7 @@ scbus-1 on xpt0 bus 0
def test_ovf_can_include_unicode(self):
xml = construct_valid_ovf_env(data={})
- xml = u'\ufeff{0}'.format(xml)
+ xml = '\ufeff{0}'.format(xml)
dsrc = self._get_ds({'ovfcontent': xml})
dsrc.get_data()
diff --git a/tests/unittests/test_datasource/test_configdrive.py b/tests/unittests/test_datasource/test_configdrive.py
index 2e2b7847..51097231 100644
--- a/tests/unittests/test_datasource/test_configdrive.py
+++ b/tests/unittests/test_datasource/test_configdrive.py
@@ -15,7 +15,7 @@ from cloudinit import util
from cloudinit.tests.helpers import CiTestCase, ExitStack, mock, populate_dir
-PUBKEY = u'ssh-rsa AAAAB3NzaC1....sIkJhq8wdX+4I3A4cYbYP ubuntu@server-460\n'
+PUBKEY = 'ssh-rsa AAAAB3NzaC1....sIkJhq8wdX+4I3A4cYbYP ubuntu@server-460\n'
EC2_META = {
'ami-id': 'ami-00000001',
'ami-launch-index': 0,
diff --git a/tests/unittests/test_datasource/test_openstack.py b/tests/unittests/test_datasource/test_openstack.py
index 478f3503..a9829c75 100644
--- a/tests/unittests/test_datasource/test_openstack.py
+++ b/tests/unittests/test_datasource/test_openstack.py
@@ -21,7 +21,7 @@ from cloudinit.sources.helpers import openstack
from cloudinit import util
BASE_URL = "http://169.254.169.254"
-PUBKEY = u'ssh-rsa AAAAB3NzaC1....sIkJhq8wdX+4I3A4cYbYP ubuntu@server-460\n'
+PUBKEY = 'ssh-rsa AAAAB3NzaC1....sIkJhq8wdX+4I3A4cYbYP ubuntu@server-460\n'
EC2_META = {
'ami-id': 'ami-00000001',
'ami-launch-index': '0',
diff --git a/tests/unittests/test_datasource/test_scaleway.py b/tests/unittests/test_datasource/test_scaleway.py
index 32f3274a..f9e968c5 100644
--- a/tests/unittests/test_datasource/test_scaleway.py
+++ b/tests/unittests/test_datasource/test_scaleway.py
@@ -209,9 +209,9 @@ class TestDataSourceScaleway(HttprettyTestCase):
self.assertEqual(self.datasource.get_instance_id(),
MetadataResponses.FAKE_METADATA['id'])
self.assertEqual(self.datasource.get_public_ssh_keys().sort(), [
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABCCCCC',
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABDDDDD',
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABA',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABCCCCC',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABDDDDD',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABA',
].sort())
self.assertEqual(self.datasource.get_hostname(),
MetadataResponses.FAKE_METADATA['hostname'])
@@ -242,8 +242,8 @@ class TestDataSourceScaleway(HttprettyTestCase):
]
self.datasource.metadata['ssh_public_keys'] = []
self.assertEqual(self.datasource.get_public_ssh_keys().sort(), [
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABDDDDD',
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABCCCCC',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABDDDDD',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABCCCCC',
].sort())
def test_ssh_keys_only_conf(self):
@@ -260,9 +260,9 @@ class TestDataSourceScaleway(HttprettyTestCase):
'fingerprint': '2048 06:ff:... login2 (RSA)'
}]
self.assertEqual(self.datasource.get_public_ssh_keys().sort(), [
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABCCCCC',
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABDDDDD',
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABA',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABCCCCC',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABDDDDD',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABA',
].sort())
def test_ssh_keys_both(self):
@@ -282,9 +282,9 @@ class TestDataSourceScaleway(HttprettyTestCase):
'fingerprint': '2048 06:ff:... login2 (RSA)'
}]
self.assertEqual(self.datasource.get_public_ssh_keys().sort(), [
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABCCCCC',
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABDDDDD',
- u'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABA',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABCCCCC',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABDDDDD',
+ 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABA',
].sort())
@mock.patch('cloudinit.sources.DataSourceScaleway.EphemeralDHCPv4')
diff --git a/tests/unittests/test_handler/test_handler_apt_source_v3.py b/tests/unittests/test_handler/test_handler_apt_source_v3.py
index abb0a9b6..687cfbf1 100644
--- a/tests/unittests/test_handler/test_handler_apt_source_v3.py
+++ b/tests/unittests/test_handler/test_handler_apt_source_v3.py
@@ -26,7 +26,7 @@ from cloudinit.sources import DataSourceNone
from cloudinit.tests import helpers as t_help
-EXPECTEDKEY = u"""-----BEGIN PGP PUBLIC KEY BLOCK-----
+EXPECTEDKEY = """-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mI0ESuZLUgEEAKkqq3idtFP7g9hzOu1a8+v8ImawQN4TrvlygfScMU1TIS1eC7UQ
diff --git a/tests/unittests/test_handler/test_handler_debug.py b/tests/unittests/test_handler/test_handler_debug.py
index 787ba350..7d43e020 100644
--- a/tests/unittests/test_handler/test_handler_debug.py
+++ b/tests/unittests/test_handler/test_handler_debug.py
@@ -41,7 +41,7 @@ class TestDebug(FilesystemMockingTestCase):
m_locale.return_value = 'en_US.UTF-8'
cfg = {
'abc': '123',
- 'c': u'\u20a0',
+ 'c': '\u20a0',
'debug': {
'verbose': True,
# Does not actually write here due to mocking...
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py
index 2290cab7..bc30c90b 100644
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -604,7 +604,7 @@ class TestMultiLog(helpers.FilesystemMockingTestCase):
class TestMessageFromString(helpers.TestCase):
def test_unicode_not_messed_up(self):
- roundtripped = util.message_from_string(u'\n').as_string()
+ roundtripped = util.message_from_string('\n').as_string()
self.assertNotIn('\x00', roundtripped)