diff options
| author | Matthew Treinish <mtreinish@kortar.org> | 2018-02-28 11:22:56 -0500 |
|---|---|---|
| committer | Matthew Treinish <mtreinish@kortar.org> | 2018-02-28 11:39:18 -0500 |
| commit | e5d60b220f7f8a549b15ea1bb08048798603111a (patch) | |
| tree | 3543e5f3fd67e1d91cb0631e4f1ac8d8a601b503 /openstackclient/tests/functional/common | |
| parent | c24451e19c2aa3f0324ff1de58f2a2d499c26404 (diff) | |
| download | python-openstackclient-e5d60b220f7f8a549b15ea1bb08048798603111a.tar.gz | |
Cleanup error messages on failure
When test_server_commands_main_help() fails it dumps a ton of
unformatted text on an exception message. This commit attempts to clean
it up to make it easier to read.
Change-Id: I793e6337728a22302a5a87938dbec60d7f2320d8
Diffstat (limited to 'openstackclient/tests/functional/common')
| -rw-r--r-- | openstackclient/tests/functional/common/test_help.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openstackclient/tests/functional/common/test_help.py b/openstackclient/tests/functional/common/test_help.py index 7f274099..3a9aef9e 100644 --- a/openstackclient/tests/functional/common/test_help.py +++ b/openstackclient/tests/functional/common/test_help.py @@ -60,8 +60,12 @@ class HelpTests(base.TestCase): """Check server commands in main help message.""" raw_output = self.openstack('help') for command, description in self.SERVER_COMMANDS: - self.assertIn(command, raw_output) - self.assertIn(description, raw_output) + msg = 'Command: %s not found in help output:\n%s' % ( + command, raw_output) + self.assertIn(command, raw_output, msg) + msg = 'Description: %s not found in help output:\n%s' % ( + description, raw_output) + self.assertIn(description, raw_output, msg) def test_server_only_help(self): """Check list of server-related commands only.""" |
