Replace assertEqual(True/False, *) with assertTrue/assertFalse in tests

In UT Test,It provides assertTrue(*) and assertFalse(*) to check the
returned value. It is not necessary to use assertEqual(True, *) or
assertEqual(False, *)

Change-Id: I335e5f542861c31ee5fa75953926e97701e50c77
Story: #2003776
Task: #26469
This commit is contained in:
Tao Li 2018-09-14 17:29:24 +08:00
parent 34b150340c
commit d13d8144bb
1 changed files with 3 additions and 3 deletions

View File

@ -126,7 +126,7 @@ class TestExclusiveWriteOrPass(test_base.BaseTest):
def test_write(self):
wrote = dnsmasq._exclusive_write_or_pass(self.path, self.buf)
self.assertEqual(True, wrote)
self.assertTrue(wrote)
self.mock_open.assert_called_once_with(self.path, 'w', 1)
self.mock_fcntl.assert_has_calls(
[self.fcntl_lock_call, self.fcntl_unlock_call])
@ -144,7 +144,7 @@ class TestExclusiveWriteOrPass(test_base.BaseTest):
None, None]
wrote = dnsmasq._exclusive_write_or_pass(self.path, self.buf)
self.assertEqual(True, wrote)
self.assertTrue(wrote)
self.mock_open.assert_called_once_with(self.path, 'w', 1)
self.mock_fcntl.assert_has_calls(
[self.fcntl_lock_call, self.fcntl_unlock_call],
@ -164,7 +164,7 @@ class TestExclusiveWriteOrPass(test_base.BaseTest):
self.mock_fcntl.side_effect = [err, None]
wrote = dnsmasq._exclusive_write_or_pass(self.path, self.buf)
self.assertEqual(False, wrote)
self.assertFalse(wrote)
self.mock_open.assert_called_once_with(self.path, 'w', 1)
self.mock_fcntl.assert_has_calls(
[self.fcntl_lock_call, self.fcntl_unlock_call])