openstack-python-openstackc.../openstackclient
Matt Riedemann 5b3a827a1f Provide stderr in exception when check_parser fails
For negative tests that are asserting an argparse failure
it would be useful to assert the specific reason for the
failure in the test rather than just getting an exception,
especially to avoid false positives in the tests when what
is being tested and failing isn't the actual expected reason
for the failure.

This wraps the check_parser code that parses the args and
mocks sys.stderr so we can trap that output and put it in the
exception message that gets raised to the test.

As a result, we can tighten up a test that was passing before
for the wrong reason [1].

[1] https://review.opendev.org/#/c/673725/12/openstackclient/tests/unit/compute/v2/test_server.py@605

Change-Id: I0f1dc1215bdfb3eba98ccaf66a0041d220b93812
2019-11-20 13:39:40 +00:00
..
api Remove token_endpoint auth type 2019-08-27 11:08:50 -05:00
common common: autogenerate docs 2019-11-05 07:09:05 -06:00
compute Microversion 2.79: Add delete_on_termination to volume-attach API 2019-11-19 21:07:20 +00:00
identity neutron: autogenerate docs 2019-11-01 14:24:30 -05:00
image Use cliff formattable columns in image commands 2019-06-22 13:36:46 -05:00
locale/tr_TR/LC_MESSAGES Imported Translations from Zanata 2018-03-01 07:25:50 +00:00
network neutron: autogenerate docs 2019-11-01 14:24:30 -05:00
object Use cliff formattable columns in object storage commands 2019-06-22 18:44:27 +00:00
tests Provide stderr in exception when check_parser fails 2019-11-20 13:39:40 +00:00
volume Default to Cinder v3 API 2019-09-09 09:35:44 -05:00
__init__.py Clean up W503 and E402 pep8 errors 2018-04-15 12:23:06 +09:00
i18n.py Remove log translations 2017-03-21 17:23:09 +08:00
shell.py Clean up app initialization and config 2019-09-09 14:01:57 +00:00