Modify assert statement when comparing with None

Replace assertEqual(None, *) with assertIsNone in heat's
tests to have more clear messages in case of failure.
Also, replace assertNotEqual(None, *) with assertIsNotNone
for the same reason.

Change-Id: I34dbf9b87c7c8c6ca4949b53bd5ef763a9c2fc24
Closes-Bug: #1280522
This commit is contained in:
Jia Dong 2014-02-15 12:01:41 +08:00 committed by joey5678
parent 8c4adee13f
commit 30d202ab42
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ class ClientsTest(HeatTestCase):
obj = clients.Clients(con) obj = clients.Clients(con)
obj._get_client_option = mock.Mock() obj._get_client_option = mock.Mock()
obj._get_client_option.return_value = None obj._get_client_option.return_value = None
self.assertEqual(None, obj._get_heat_url()) self.assertIsNone(obj._get_heat_url())
heat_url = "http://0.0.0.0:8004/v1/%(tenant_id)s" heat_url = "http://0.0.0.0:8004/v1/%(tenant_id)s"
obj._get_client_option.return_value = heat_url obj._get_client_option.return_value = heat_url
tenant_id = "b363706f891f48019483f8bd6503c54b" tenant_id = "b363706f891f48019483f8bd6503c54b"

View File

@ -908,7 +908,7 @@ class StackServiceCreateUpdateDeleteTest(HeatTestCase):
self.assertEqual((old_stack.UPDATE, old_stack.COMPLETE), self.assertEqual((old_stack.UPDATE, old_stack.COMPLETE),
old_stack.state) old_stack.state)
self.assertEqual(create_stack.identifier(), result) self.assertEqual(create_stack.identifier(), result)
self.assertNotEqual(None, create_stack.identifier().stack_id) self.assertIsNotNone(create_stack.identifier().stack_id)
self.assertEqual(create_stack.identifier().arn(), self.assertEqual(create_stack.identifier().arn(),
old_stack['A'].properties['Foo']) old_stack['A'].properties['Foo'])
@ -989,7 +989,7 @@ class StackServiceCreateUpdateDeleteTest(HeatTestCase):
self.assertEqual((old_nested.UPDATE, old_nested.COMPLETE), self.assertEqual((old_nested.UPDATE, old_nested.COMPLETE),
old_nested.state) old_nested.state)
self.assertEqual(create_stack.identifier(), result) self.assertEqual(create_stack.identifier(), result)
self.assertNotEqual(None, create_stack.identifier().stack_id) self.assertIsNotNone(create_stack.identifier().stack_id)
self.assertEqual(create_nested.identifier().arn(), self.assertEqual(create_nested.identifier().arn(),
old_nested['A'].properties['Foo']) old_nested['A'].properties['Foo'])