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: I9246fac952c59d3ddc1458c16c53fc988ac095d3
This commit is contained in:
Cady_Chen 2016-12-20 01:33:05 +08:00
parent d80a8dae25
commit 9e1e030c98
1 changed files with 1 additions and 1 deletions

View File

@ -256,7 +256,7 @@ class TestParted(unittest2.TestCase):
def test_next_name_none(self, nt_mock, nc_mock):
nc_mock.return_value = 1
nt_mock.return_value = 'extended'
self.assertEqual(None, self.prtd.next_name())
self.assertIsNone(self.prtd.next_name())
@mock.patch.object(objects.Parted, 'next_count')
@mock.patch.object(objects.Parted, 'next_type')