Skip to content

Commit

Permalink
chore: fix lints
Browse files Browse the repository at this point in the history
Signed-off-by: JP-Ellis <josh@jpellis.me>
  • Loading branch information
JP-Ellis committed Nov 15, 2023
1 parent 32c2a72 commit 5d16769
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
@@ -1,3 +1,3 @@
[submodule "compatibility-suite"]
path = tests/v3/compatibility-suite/definition
path = tests/v3/compatiblity_suite/definition
url = ../pact-compatibility-suite.git
File renamed without changes.
File renamed without changes.
Expand Up @@ -342,7 +342,7 @@ def the_following_http_interactions_have_been_defined(
converters={"ids": lambda s: list(map(int, s.split(",")))},
target_fixture="srv",
)
def the_mock_server_is_started_with_interactions(
def the_mock_server_is_started_with_interactions( # noqa: C901
ids: list[int],
interaction_definitions: dict[int, InteractionDefinition],
) -> Generator[PactServer, Any, None]:
Expand Down Expand Up @@ -377,7 +377,7 @@ def the_mock_server_is_started_with_interactions(
definition.body.string,
definition.body.mime_type,
)
else:
elif definition.body.bytes:
logging.info(
"-> with_binary_file(%s, %s)",
truncate(definition.body.bytes),
Expand All @@ -387,6 +387,9 @@ def the_mock_server_is_started_with_interactions(
definition.body.bytes,
definition.body.mime_type,
)
else:
msg = "Unexpected body definition"
raise RuntimeError(msg)

logging.info("-> will_respond_with(%s)", definition.response)
interaction.will_respond_with(definition.response)
Expand All @@ -406,7 +409,7 @@ def the_mock_server_is_started_with_interactions(
definition.response_body.string,
definition.response_content,
)
else:
elif definition.response_body.bytes:
logging.info(
"-> with_binary_file(%s, %s)",
truncate(definition.response_body.bytes),
Expand All @@ -416,6 +419,9 @@ def the_mock_server_is_started_with_interactions(
definition.response_body.bytes,
definition.response_content,
)
else:
msg = "Unexpected body definition"
raise RuntimeError(msg)

with pact.serve(raises=False) as srv:
yield srv
Expand Down
File renamed without changes.

0 comments on commit 5d16769

Please sign in to comment.