We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We got asked the question in slack, as to whether you could verify pacts in a directory or from multiple locations.
The function currently expects a comma separated string of file paths, so passing a directory as the first argument will fail.
Here are a couple of examples. feel free to add your own
This commit shows a working example (utilising pact-python 2.0.0)
88918cf
def list_full_paths(directory): return [os.path.join(directory, file) for file in os.listdir(directory)] output, _ = verifier.verify_pacts( ','.join(map(str, list_full_paths("../pacts"))), verbose=False, provider_states_setup_url="{}/_pact/provider_states".format(PROVIDER_URL), )
Might not be an ideal solution, but if it gets readers out of a bind.
Solution provided by Ivan Mikhalka over in Slack, thanks 👍🏾
pact_files = [] if not os.environ.get("CONSUMER_1_CONTRACT_PATH") is None: pact_files.append("{}".format(os.environ["CONSUMER_1_CONTRACT_PATH"])) if not os.environ.get("CONSUMER_2_CONTRACT_PATH") is None: pact_files.append("{}".format(os.environ["CONSUMER_2_CONTRACT_PATH"])) success, logs = verifier.verify_pacts(*pact_files)
export CONSUMER_1_CONTRACT=<path/to/contract1> && export CONSUMER_2_CONTRACT=<path/to/contract2> && pytest provider_test.py
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
We got asked the question in slack, as to whether you could verify pacts in a directory or from multiple locations.
The function currently expects a comma separated string of file paths, so passing a directory as the first argument will fail.
Here are a couple of examples. feel free to add your own
Read by Directory
This commit shows a working example (utilising pact-python 2.0.0)
88918cf
Might not be an ideal solution, but if it gets readers out of a bind.
Read from multiple locations
Solution provided by Ivan Mikhalka over in Slack, thanks 👍🏾
The text was updated successfully, but these errors were encountered: