summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/test_datasource')
-rw-r--r--tests/unittests/test_datasource/test_altcloud.py2
-rw-r--r--tests/unittests/test_datasource/test_azure.py2
-rw-r--r--tests/unittests/test_datasource/test_maas.py2
-rw-r--r--tests/unittests/test_datasource/test_opennebula.py4
-rw-r--r--tests/unittests/test_datasource/test_openstack.py4
-rw-r--r--tests/unittests/test_datasource/test_ovf.py2
6 files changed, 8 insertions, 8 deletions
diff --git a/tests/unittests/test_datasource/test_altcloud.py b/tests/unittests/test_datasource/test_altcloud.py
index 63a2b04d..b6d4a453 100644
--- a/tests/unittests/test_datasource/test_altcloud.py
+++ b/tests/unittests/test_datasource/test_altcloud.py
@@ -419,7 +419,7 @@ class TestReadUserDataCallback(TestCase):
'''Test read_user_data_callback() no files are found.'''
_remove_user_data_files(self.mount_dir)
- self.assertEqual(None, dsac.read_user_data_callback(self.mount_dir))
+ self.assertIsNone(dsac.read_user_data_callback(self.mount_dir))
def force_arch(arch=None):
diff --git a/tests/unittests/test_datasource/test_azure.py b/tests/unittests/test_datasource/test_azure.py
index 67cddeb9..852ec703 100644
--- a/tests/unittests/test_datasource/test_azure.py
+++ b/tests/unittests/test_datasource/test_azure.py
@@ -239,7 +239,7 @@ fdescfs /dev/fd fdescfs rw 0 0
with mock.patch.object(os.path, 'exists',
return_value=True):
res = get_path_dev_freebsd('/etc', mnt_list)
- self.assertNotEqual(res, None)
+ self.assertIsNotNone(res)
def test_basic_seed_dir(self):
odata = {'HostName': "myhost", 'UserName': "myuser"}
diff --git a/tests/unittests/test_datasource/test_maas.py b/tests/unittests/test_datasource/test_maas.py
index 693882d2..c1911bf4 100644
--- a/tests/unittests/test_datasource/test_maas.py
+++ b/tests/unittests/test_datasource/test_maas.py
@@ -44,7 +44,7 @@ class TestMAASDataSource(TestCase):
# verify that 'userdata' is not returned as part of the metadata
self.assertFalse(('user-data' in md))
- self.assertEqual(vd, None)
+ self.assertIsNone(vd)
def test_seed_dir_valid_extra(self):
"""Verify extra files do not affect seed_dir validity."""
diff --git a/tests/unittests/test_datasource/test_opennebula.py b/tests/unittests/test_datasource/test_opennebula.py
index bce66125..b0f8e435 100644
--- a/tests/unittests/test_datasource/test_opennebula.py
+++ b/tests/unittests/test_datasource/test_opennebula.py
@@ -126,14 +126,14 @@ class TestOpenNebulaDataSource(TestCase):
populate_dir(self.seed_dir, {'context.sh': ''})
results = ds.read_context_disk_dir(self.seed_dir)
- self.assertEqual(results['userdata'], None)
+ self.assertIsNone(results['userdata'])
self.assertEqual(results['metadata'], {})
def test_seed_dir_empty2_context(self):
populate_context_dir(self.seed_dir, {})
results = ds.read_context_disk_dir(self.seed_dir)
- self.assertEqual(results['userdata'], None)
+ self.assertIsNone(results['userdata'])
self.assertEqual(results['metadata'], {})
def test_seed_dir_broken_context(self):
diff --git a/tests/unittests/test_datasource/test_openstack.py b/tests/unittests/test_datasource/test_openstack.py
index 7bf55084..c2905d1a 100644
--- a/tests/unittests/test_datasource/test_openstack.py
+++ b/tests/unittests/test_datasource/test_openstack.py
@@ -242,7 +242,7 @@ class TestOpenStackDataSource(test_helpers.HttprettyTestCase):
self.assertEqual(USER_DATA, ds_os.userdata_raw)
self.assertEqual(2, len(ds_os.files))
self.assertEqual(VENDOR_DATA, ds_os.vendordata_pure)
- self.assertEqual(ds_os.vendordata_raw, None)
+ self.assertIsNone(ds_os.vendordata_raw)
@hp.activate
def test_bad_datasource_meta(self):
@@ -318,7 +318,7 @@ class TestVendorDataLoading(test_helpers.TestCase):
self.assertEqual(self.cvj(data), data)
def test_vd_load_dict_no_ci(self):
- self.assertEqual(self.cvj({'foo': 'bar'}), None)
+ self.assertIsNone(self.cvj({'foo': 'bar'}))
def test_vd_load_dict_ci_dict(self):
self.assertRaises(ValueError, self.cvj,
diff --git a/tests/unittests/test_datasource/test_ovf.py b/tests/unittests/test_datasource/test_ovf.py
index 3e09510c..477cf8ed 100644
--- a/tests/unittests/test_datasource/test_ovf.py
+++ b/tests/unittests/test_datasource/test_ovf.py
@@ -68,6 +68,6 @@ class TestReadOvfEnv(test_helpers.TestCase):
md, ud, cfg = dsovf.read_ovf_environment(env)
self.assertEqual({"instance-id": "inst-001"}, md)
self.assertEqual({'password': "passw0rd"}, cfg)
- self.assertEqual(None, ud)
+ self.assertIsNone(ud)
# vi: ts=4 expandtab