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
This commit is contained in:
jiansong 2016-08-30 05:10:02 -07:00
parent 26087fd58c
commit 4c2d8b72e8
2 changed files with 4 additions and 4 deletions

View File

@ -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")

View File

@ -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