Skip to content

Commit

Permalink
chore: fix lints
Browse files Browse the repository at this point in the history
Signed-off-by: JP-Ellis <[email protected]>
  • Loading branch information
JP-Ellis committed Nov 15, 2023
1 parent 1763eb3 commit e49ced9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
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 e49ced9

Please sign in to comment.