Skip to content

Commit

Permalink
demo: show way to verifying all pacts in a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jul 25, 2023
1 parent 00dcacd commit 88918cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/fastapi_provider/tests/provider/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging

import pytest
import os

from pact import Verifier

Expand Down Expand Up @@ -78,8 +79,12 @@ def test_user_service_provider_against_pact(server):
# if it has been successful in the past (since this is what the Pact Broker
# is for), if the verification of an interaction fails then the success
# result will be != 0, and so the test will FAIL.

def list_full_paths(directory):
return [os.path.join(directory, file) for file in os.listdir(directory)]

output, _ = verifier.verify_pacts(
"../pacts/userserviceclient-userservice.json",
','.join(map(str, list_full_paths("../pacts"))),
verbose=False,
provider_states_setup_url="{}/_pact/provider_states".format(PROVIDER_URL),
)
Expand Down

0 comments on commit 88918cf

Please sign in to comment.