diff options
author | jiansong <jian.song@easystack.cn> | 2016-08-30 05:10:02 -0700 |
---|---|---|
committer | jiansong <jian.song@easystack.cn> | 2016-09-11 00:21:36 -0700 |
commit | 4c2d8b72e850bf6ae07f895db3c343fc3a41bcdf (patch) | |
tree | 7317b60e2a50a60738a4b3108d1c4cd19426b6fd | |
parent | 26087fd58c4d9e39cdf12171266cb21c9f18e1bd (diff) | |
download | trove-integration-4c2d8b72e850bf6ae07f895db3c343fc3a41bcdf.tar.gz |
Replace assertEqual(None, *) with assertIsNone
From python 2.7 onwards, some new method such as assertIsNone
equivalent to the assertEqual,this will simplify the number of
parameters.
I am looking for all the assert method, which can be updated and
renewed,and changed the place where I think they can change.
These changes should be harmless
refer to [1] for more information
[1]:https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.assertIsNone
Closes-Bug #1618434
Change-Id: I67db37a0f7561c638d5bb8f2ccd894fa07f6109e
-rw-r--r-- | tests/integration/tests/dns/conversion.py | 4 | ||||
-rw-r--r-- | tests/integration/tests/volumes/driver.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/integration/tests/dns/conversion.py b/tests/integration/tests/dns/conversion.py index d22e993..2af3b95 100644 --- a/tests/integration/tests/dns/conversion.py +++ b/tests/integration/tests/dns/conversion.py @@ -96,10 +96,10 @@ class WhenCreatingAnEntryForAnInstance(unittest.TestCase): FLAGS.dns_domain_name) self.assertEqual(expected_name, entry.name, msg="Entry name should match - %s" % entry.name) - self.assertEqual(None, entry.content) + self.assertIsNone(entry.content) self.assertEqual("A", entry.type) self.assertEqual(FLAGS.dns_ttl, entry.ttl) - self.assertEqual(None, entry.priority) + self.assertIsNone(entry.priority) self.assertEqual(FLAGS.dns_domain_name, entry.dns_zone.name) if not entry.dns_zone.id: self.fail(msg="DNS Zone Id should not be empty") diff --git a/tests/integration/tests/volumes/driver.py b/tests/integration/tests/volumes/driver.py index e21648f..6950046 100644 --- a/tests/integration/tests/volumes/driver.py +++ b/tests/integration/tests/volumes/driver.py @@ -206,7 +206,7 @@ class AddVolumeFailure(VolumeTest): Make call to FAIL a prov. volume and assert the return value is a FAILURE. """ - self.assertEqual(None, self.storyFail.volume_id) + self.assertIsNone(self.storyFail.volume_id) name = "TestVolume" desc = "A volume that was created for testing." self.storyFail.volume_name = name @@ -257,7 +257,7 @@ class AddVolume(VolumeTest): @time_out(60) def test_add(self): """Make call to prov. a volume and assert the return value is OK.""" - self.assertEqual(None, self.story.volume_id) + self.assertIsNone(self.story.volume_id) name = "TestVolume" desc = "A volume that was created for testing." self.story.volume_name = name |