Using assertIsNone() is preferred over assertEqual()
Following OpenStack Style Guidelines[1]. [H203] Unit test assertions tend to give better messages for more specific assertions. As a result, assertIsNone(...) is preferred over assertEqual(None, ...) [1] http://docs.openstack.org/developer/hacking/#dictionaries-lists Change-Id: I46681aad0e7bae5c4b1f62db7987da24f516613d
This commit is contained in:
parent
5e07d2bb4c
commit
ca6ef56f09
@ -80,7 +80,7 @@ class TestNodeStatesV1_1(TestNodeStatesMixin, base.BaseBaremetalTest):
|
||||
def test_set_node_provision_state(self):
|
||||
_, node = self.create_node(self.chassis['uuid'])
|
||||
# Nodes appear in NONE state by default until v1.1
|
||||
self.assertEqual(None, node['provision_state'])
|
||||
self.assertIsNone(node['provision_state'])
|
||||
provision_states_list = ['active', 'deleted']
|
||||
target_states_list = ['active', None]
|
||||
for (provision_state, target_state) in zip(provision_states_list,
|
||||
|
Loading…
Reference in New Issue
Block a user