Use assertIsNone(...) instead of assertEqual(None, ...).
Ref£º http://docs.openstack.org/developer/hacking/#real-world-import-order-examples [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, ...), and assertIsNotNone(...) is preferred over assertNotEqual(None, ...) and assertIsNot(None, ...). Change-Id: Idcf78fce02b01c41816a34efcb1264d69ce71706
This commit is contained in:
parent
d557174631
commit
669c9428d8
|
@ -85,7 +85,7 @@ class ShellTest(utils.TestCase):
|
|||
|
||||
def test_positive_non_zero_float(self):
|
||||
output = magnumclient.shell.positive_non_zero_float(None)
|
||||
self.assertEqual(None, output)
|
||||
self.assertIsNone(output)
|
||||
|
||||
output = magnumclient.shell.positive_non_zero_float(5)
|
||||
self.assertEqual(5, output)
|
||||
|
|
Loading…
Reference in New Issue