Skip to content

Commit

Permalink
feat(verifier): support --enable-pending flag in CLI
Browse files Browse the repository at this point in the history
Closes #164
  • Loading branch information
Maciej Olko committed Sep 3, 2020
1 parent 701578b commit b2828ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pact/cli/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()))
Expand Down
7 changes: 5 additions & 2 deletions tests/cli/test_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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):
Expand Down

0 comments on commit b2828ab

Please sign in to comment.