Use assertIsNone(...) instead of assertEqual(None, ...)

Refer to:http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises

[H203] Use assertIs(Not)None to check for None (off by default) Unit
test assertions tend to give better messages for more specific assertions.
As a result, assertIsNone(...) is preferred over assertEqual(None, ...)
and assertIs(None, ...)

Change-Id: Id20e7958bc0228577eb73ee390afc80ffcb98d33
This commit is contained in:
LiuNanke 2016-12-12 13:55:41 +08:00
parent 16f8bfcba7
commit c38f68e745
1 changed files with 2 additions and 2 deletions

View File

@ -147,8 +147,8 @@ class PortChainTest(common.HeatTestCase):
def test_resource_show_resource(self):
mock_pc_get = self.test_client_plugin.show_sfc_resource
mock_pc_get.return_value = None
self.assertEqual(None, self.test_resource._show_resource(),
'Failed to show resource')
self.assertIsNone(self.test_resource._show_resource(),
'Failed to show resource')
def test_resource_handle_update(self):
mock_ppg_patch = self.test_client_plugin.update_sfc_resource