Refactor assertEqual statement that includes 'True'

We have a hacking check to make sure assertTrue is used instead of
assertEqual(True, something). The regex used for that likely needs to be
fixed as it's overly complex for what it is trying to match.

We are seeing pep8 failures flagging an instance of assertEqual that is
comparing a tuple that happens to contain True as one of its values. As
an easier path to get around this failure until someone can reevaluate
the hacking check regex, this just reformats the test code so that it no
longer gets matched by the existing regex.

Change-Id: If2d2554f3509d3da7a6b625fd900d2090a3fe0f2
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-06-17 09:36:42 -05:00
parent 7d8f400791
commit 8913461aa9
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
1 changed files with 2 additions and 1 deletions

View File

@ -438,5 +438,6 @@ class TestPortForwardingPlugin(testlib_api.SqlTestCase):
mock_config_opts_get.side_effect = cfg.NoSuchOptError('test_svc_plug')
plugins, rpc_required = pf_plugin._required_service_plugins()
mock_config_opts_get.assert_called_once()
expected = (['router'], True)
self.assertEqual(
(['router'], True), (plugins, rpc_required), description)
expected, (plugins, rpc_required), description)