Skip to content

Commit 1c5c5aa

Browse files
committedOct 9, 2024·
fix: typing annotations
With the `Matcher` accepting a generic typevar, there were a few instances where the typevar was missing. Signed-off-by: JP-Ellis <josh@jpellis.me>
1 parent 6b85a31 commit 1c5c5aa

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed
 

‎src/pact/v3/interaction/_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def given(
248248

249249
def with_body(
250250
self,
251-
body: str | dict | Matcher | None = None,
251+
body: str | dict[str, Any] | Matcher[Any] | None = None,
252252
content_type: str | None = None,
253253
part: Literal["Request", "Response"] | None = None,
254254
) -> Self:

‎src/pact/v3/interaction/_http_interaction.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _interaction_part(self) -> pact.v3.ffi.InteractionPart:
9797
"""
9898
return self.__interaction_part
9999

100-
def with_request(self, method: str, path: str | Matcher) -> Self:
100+
def with_request(self, method: str, path: str | Matcher[Any]) -> Self:
101101
"""
102102
Set the request.
103103
@@ -119,7 +119,7 @@ def with_request(self, method: str, path: str | Matcher) -> Self:
119119
def with_header(
120120
self,
121121
name: str,
122-
value: str | dict | Matcher,
122+
value: str | dict[str, str] | Matcher[Any],
123123
part: Literal["Request", "Response"] | None = None,
124124
) -> Self:
125125
r"""
@@ -353,7 +353,11 @@ def set_headers(
353353
self.set_header(name, value, part)
354354
return self
355355

356-
def with_query_parameter(self, name: str, value: str | dict | Matcher) -> Self:
356+
def with_query_parameter(
357+
self,
358+
name: str,
359+
value: str | dict[str, str] | Matcher[Any],
360+
) -> Self:
357361
r"""
358362
Add a query to the request.
359363

0 commit comments

Comments
 (0)
Please sign in to comment.