Skip to content

Commit

Permalink
fix(examples): do not overwrite pact file on every test
Browse files Browse the repository at this point in the history
the overwrite caused only the last test-case to be saved as interaction
in the pact JSON file
  • Loading branch information
individual-it authored and JP-Ellis committed Oct 7, 2024
1 parent 6e40ba7 commit 75ad5d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/tests/v3/test_00_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def pact() -> Generator[Pact, None, None]:
pact_dir = Path(Path(__file__).parent.parent.parent / "pacts")
pact = Pact("v3_http_consumer", "v3_http_provider")
yield pact.with_specification("V4")
pact.write_file(pact_dir, overwrite=True)
pact.write_file(pact_dir)


def test_get_existing_user(pact: Pact) -> None:
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/v3/test_01_fastapi_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def verify_mock_post_request_to_create_user() -> None:
if TYPE_CHECKING:
examples.src.fastapi.FAKE_DB = MagicMock()

assert len(examples.src.fastapi.FAKE_DB.mock_calls) == 2
assert len(examples.src.fastapi.FAKE_DB.mock_calls) == 3

examples.src.fastapi.FAKE_DB.__getitem__.assert_called_once()
args, kwargs = examples.src.fastapi.FAKE_DB.__getitem__.call_args
Expand Down

0 comments on commit 75ad5d4

Please sign in to comment.