From 7bf27252e57779252fd0ab1cf7f0062f9c27995b Mon Sep 17 00:00:00 2001 From: Chang Bo Guo <guochbo@cn.ibm.com> Date: Tue, 8 Oct 2013 19:04:08 -0700 Subject: [PATCH] Fix misused assertTrue in unit tests Refactored unit tests to use assertEqual instead of assertTrue where needed. Closes-Bug: #1226374 Change-Id: I5f3b582e19f3461a04b5df05960095779ec8aa1a --- tests/test_shell.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_shell.py b/tests/test_shell.py index b8da93ab..cdbd632a 100644 --- a/tests/test_shell.py +++ b/tests/test_shell.py @@ -87,7 +87,9 @@ class ShellTest(utils.TestCase): conflict_handler='error', add_help=False, formatter_class=openstack_shell.HelpFormatter,) - self.assertTrue(expected, actual_parser) + # NOTE(guochbo): Can't compare ArgumentParser instances directly + # Convert ArgumentPaser to string first. + self.assertEqual(str(expected), str(actual_parser)) def test_get_image_url_by_ipv6Addr_host(self): fake_args = lambda: None