summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2019-03-04 16:50:31 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-03-04 16:50:31 +0000
commiteee0e09ead3d11c32e8888d13d164810ee5f19d6 (patch)
tree8ba1a47c063c2c5f5c713c4eba1c2956f813b5ba
parentbd35300ba36bd63686715fa9661516a518781f6d (diff)
downloadcloud-init-git-eee0e09ead3d11c32e8888d13d164810ee5f19d6.tar.gz
tip-pylint: Fix assignment-from-return-none errors
pylint now complains about assignment of None from a return of a function call. This does not account for subclassing so we resolve this issue by removing the assignment in the unittest.
-rw-r--r--tests/unittests/test_datasource/test_configdrive.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/unittests/test_datasource/test_configdrive.py b/tests/unittests/test_datasource/test_configdrive.py
index dcdabea5..7a6802f6 100644
--- a/tests/unittests/test_datasource/test_configdrive.py
+++ b/tests/unittests/test_datasource/test_configdrive.py
@@ -268,8 +268,7 @@ class TestConfigDriveDataSource(CiTestCase):
exists_mock = mocks.enter_context(
mock.patch.object(os.path, 'exists',
side_effect=exists_side_effect()))
- device = cfg_ds.device_name_to_device(name)
- self.assertEqual(dev_name, device)
+ self.assertEqual(dev_name, cfg_ds.device_name_to_device(name))
find_mock.assert_called_once_with(mock.ANY)
self.assertEqual(exists_mock.call_count, 2)
@@ -296,8 +295,7 @@ class TestConfigDriveDataSource(CiTestCase):
exists_mock = mocks.enter_context(
mock.patch.object(os.path, 'exists',
return_value=True))
- device = cfg_ds.device_name_to_device(name)
- self.assertEqual(dev_name, device)
+ self.assertEqual(dev_name, cfg_ds.device_name_to_device(name))
find_mock.assert_called_once_with(mock.ANY)
exists_mock.assert_called_once_with(mock.ANY)
@@ -331,8 +329,7 @@ class TestConfigDriveDataSource(CiTestCase):
yield True
with mock.patch.object(os.path, 'exists',
side_effect=exists_side_effect()):
- device = cfg_ds.device_name_to_device(name)
- self.assertEqual(dev_name, device)
+ self.assertEqual(dev_name, cfg_ds.device_name_to_device(name))
# We don't assert the call count for os.path.exists() because
# not all of the entries in name_tests results in two calls to
# that function. Specifically, 'root2k' doesn't seem to call
@@ -359,8 +356,7 @@ class TestConfigDriveDataSource(CiTestCase):
}
for name, dev_name in name_tests.items():
with mock.patch.object(os.path, 'exists', return_value=True):
- device = cfg_ds.device_name_to_device(name)
- self.assertEqual(dev_name, device)
+ self.assertEqual(dev_name, cfg_ds.device_name_to_device(name))
def test_dir_valid(self):
"""Verify a dir is read as such."""