diff options
author | Tao Li <litao3721@126.com> | 2018-09-14 17:29:24 +0800 |
---|---|---|
committer | Tao Li <litao3721@126.com> | 2018-09-17 09:10:46 +0000 |
commit | d13d8144bb0af4b1687c94e24f0fc57bfe86985b (patch) | |
tree | ee4ad3da586933ddd203f649cda8518e49ff956c | |
parent | 34b150340cbb1650e7195b4496a9c74150e68db8 (diff) |
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
Notes
Notes (review):
Code-Review+2: Kaifeng Wang <kaifeng.w@gmail.com>
Code-Review+2: Dmitry Tantsur <divius.inside@gmail.com>
Workflow+1: Dmitry Tantsur <divius.inside@gmail.com>
Verified+2: Zuul
Submitted-by: Zuul
Submitted-at: Mon, 17 Sep 2018 12:25:41 +0000
Reviewed-on: https://review.openstack.org/602582
Project: openstack/ironic-inspector
Branch: refs/heads/master
-rw-r--r-- | ironic_inspector/test/unit/test_dnsmasq_pxe_filter.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ironic_inspector/test/unit/test_dnsmasq_pxe_filter.py b/ironic_inspector/test/unit/test_dnsmasq_pxe_filter.py index 2b9511b..312cf6c 100644 --- a/ironic_inspector/test/unit/test_dnsmasq_pxe_filter.py +++ b/ironic_inspector/test/unit/test_dnsmasq_pxe_filter.py | |||
@@ -126,7 +126,7 @@ class TestExclusiveWriteOrPass(test_base.BaseTest): | |||
126 | 126 | ||
127 | def test_write(self): | 127 | def test_write(self): |
128 | wrote = dnsmasq._exclusive_write_or_pass(self.path, self.buf) | 128 | wrote = dnsmasq._exclusive_write_or_pass(self.path, self.buf) |
129 | self.assertEqual(True, wrote) | 129 | self.assertTrue(wrote) |
130 | self.mock_open.assert_called_once_with(self.path, 'w', 1) | 130 | self.mock_open.assert_called_once_with(self.path, 'w', 1) |
131 | self.mock_fcntl.assert_has_calls( | 131 | self.mock_fcntl.assert_has_calls( |
132 | [self.fcntl_lock_call, self.fcntl_unlock_call]) | 132 | [self.fcntl_lock_call, self.fcntl_unlock_call]) |
@@ -144,7 +144,7 @@ class TestExclusiveWriteOrPass(test_base.BaseTest): | |||
144 | None, None] | 144 | None, None] |
145 | wrote = dnsmasq._exclusive_write_or_pass(self.path, self.buf) | 145 | wrote = dnsmasq._exclusive_write_or_pass(self.path, self.buf) |
146 | 146 | ||
147 | self.assertEqual(True, wrote) | 147 | self.assertTrue(wrote) |
148 | self.mock_open.assert_called_once_with(self.path, 'w', 1) | 148 | self.mock_open.assert_called_once_with(self.path, 'w', 1) |
149 | self.mock_fcntl.assert_has_calls( | 149 | self.mock_fcntl.assert_has_calls( |
150 | [self.fcntl_lock_call, self.fcntl_unlock_call], | 150 | [self.fcntl_lock_call, self.fcntl_unlock_call], |
@@ -164,7 +164,7 @@ class TestExclusiveWriteOrPass(test_base.BaseTest): | |||
164 | self.mock_fcntl.side_effect = [err, None] | 164 | self.mock_fcntl.side_effect = [err, None] |
165 | 165 | ||
166 | wrote = dnsmasq._exclusive_write_or_pass(self.path, self.buf) | 166 | wrote = dnsmasq._exclusive_write_or_pass(self.path, self.buf) |
167 | self.assertEqual(False, wrote) | 167 | self.assertFalse(wrote) |
168 | self.mock_open.assert_called_once_with(self.path, 'w', 1) | 168 | self.mock_open.assert_called_once_with(self.path, 'w', 1) |
169 | self.mock_fcntl.assert_has_calls( | 169 | self.mock_fcntl.assert_has_calls( |
170 | [self.fcntl_lock_call, self.fcntl_unlock_call]) | 170 | [self.fcntl_lock_call, self.fcntl_unlock_call]) |