Using assertIsNotNone() instead of assertIsNot(None)
Following OpenStack Style Guidelines[1]: [H203] Unit test assertions tend to give better messages for more specific assertions. As a result, assertIsNotNone(...) is preferred over assertNotEqual(None, ...) and assertIsNot(None, ...) [1]http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises Change-Id: Ie421629e0c78516595086510ba74130bfe6d1086
This commit is contained in:
parent
adc05d8415
commit
7bc114bfe5
|
@ -21,7 +21,7 @@ def store_b_uuid():
|
|||
def check_b_not_replaced():
|
||||
test.assertEqual(b_uuid,
|
||||
next(iter(reality.resources_by_logical_name('B'))).uuid)
|
||||
test.assertIsNot(b_uuid, None)
|
||||
test.assertIsNotNone(b_uuid)
|
||||
|
||||
example_template = Template({
|
||||
'A': RsrcDef({}, []),
|
||||
|
|
|
@ -21,7 +21,7 @@ def store_c_uuid():
|
|||
def check_c_replaced():
|
||||
test.assertNotEqual(c_uuid,
|
||||
next(iter(reality.resources_by_logical_name('C'))).uuid)
|
||||
test.assertIsNot(c_uuid, None)
|
||||
test.assertIsNotNone(c_uuid)
|
||||
|
||||
|
||||
example_template = Template({
|
||||
|
|
|
@ -21,7 +21,7 @@ def store_c_uuid():
|
|||
def check_c_replaced():
|
||||
test.assertNotEqual(c_uuid,
|
||||
next(iter(reality.resources_by_logical_name('newC'))).uuid)
|
||||
test.assertIsNot(c_uuid, None)
|
||||
test.assertIsNotNone(c_uuid)
|
||||
|
||||
|
||||
example_template = Template({
|
||||
|
|
Loading…
Reference in New Issue