From b2828aba6b0652aeca233b4991dc8f8504b5703a Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Thu, 3 Sep 2020 17:10:04 +0200 Subject: [PATCH] feat(verifier): support --enable-pending flag in CLI Closes #164 --- pact/cli/verify.py | 6 +++--- tests/cli/test_verify.py | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pact/cli/verify.py b/pact/cli/verify.py index 99fccfce79..01b5d35dfc 100644 --- a/pact/cli/verify.py +++ b/pact/cli/verify.py @@ -111,8 +111,8 @@ 'log_level', '--log-level', help='The logging level.') @click.option( - 'enable_pending', '--enable-pending', - default=False, + 'enable_pending', '--enable-pending/--no-enable-pending', + default=None, help='Allow pacts which are in pending state to be verified without causing the' ' overall task to fail. For more information, see https://pact.io/pending', is_flag=True) @@ -176,7 +176,7 @@ def main(pacts, base_url, pact_url, pact_urls, states_url, states_setup_url, 'consumer_selectors': list(consumer_version_selector), 'provider_tags': list(provider_version_tag), 'provider_states_setup_url': states_setup_url, - + 'enable_pending': enable_pending, } options = dict(filter(lambda item: item[1] is not None, options.items())) diff --git a/tests/cli/test_verify.py b/tests/cli/test_verify.py index 79b16e47e8..67e6e4f3c3 100644 --- a/tests/cli/test_verify.py +++ b/tests/cli/test_verify.py @@ -228,7 +228,8 @@ def test_all_url_options(self, mock_isfile, mock_wrapper): '--log-dir=tmp/logs/pact.test.log', '--log-level=INFO', '--timeout=60', - '--verbose' + '--verbose', + '--enable-pending', ]) self.assertEqual(result.exit_code, 0, result.output) @@ -250,7 +251,9 @@ def test_all_url_options(self, mock_isfile, mock_wrapper): log_dir='tmp/logs/pact.test.log', log_level='INFO', timeout=60, - verbose=True) + verbose=True, + enable_pending=True, + ) @patch("pact.verify_wrapper.VerifyWrapper.call_verify") def test_all_broker_options(self, mock_wrapper):