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
changes/73/73773/5
Jia Dong 9 years ago committed by joey5678
parent 8c4adee13f
commit 30d202ab42
  1. 2
      heat/tests/test_clients.py
  2. 4
      heat/tests/test_engine_service.py

@ -31,7 +31,7 @@ class ClientsTest(HeatTestCase):
obj = clients.Clients(con)
obj._get_client_option = mock.Mock()
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"
obj._get_client_option.return_value = heat_url
tenant_id = "b363706f891f48019483f8bd6503c54b"

@ -908,7 +908,7 @@ class StackServiceCreateUpdateDeleteTest(HeatTestCase):
self.assertEqual((old_stack.UPDATE, old_stack.COMPLETE),
old_stack.state)
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(),
old_stack['A'].properties['Foo'])
@ -989,7 +989,7 @@ class StackServiceCreateUpdateDeleteTest(HeatTestCase):
self.assertEqual((old_nested.UPDATE, old_nested.COMPLETE),
old_nested.state)
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(),
old_nested['A'].properties['Foo'])

Loading…
Cancel
Save