Skip to content

Commit

Permalink
chore(deps): update dependency dev/black to v24
Browse files Browse the repository at this point in the history
Signed-off-by: JP-Ellis <josh@jpellis.me>
  • Loading branch information
renovate[bot] authored and JP-Ellis committed Jan 29, 2024
1 parent a7f4518 commit 3808404
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 98 deletions.
108 changes: 36 additions & 72 deletions pact/v3/ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,32 +101,25 @@
# to inform the type checker of the existence of these types.


class AsynchronousMessage:
...
class AsynchronousMessage: ...


class Consumer:
...
class Consumer: ...


class Generator:
...
class Generator: ...


class GeneratorCategoryIterator:
...
class GeneratorCategoryIterator: ...


class GeneratorKeyValuePair:
...
class GeneratorKeyValuePair: ...


class HttpRequest:
...
class HttpRequest: ...


class HttpResponse:
...
class HttpResponse: ...


class InteractionHandle:
Expand Down Expand Up @@ -160,84 +153,64 @@ def __repr__(self) -> str:
return f"InteractionHandle({self._ref!r})"


class MatchingRule:
...
class MatchingRule: ...


class MatchingRuleCategoryIterator:
...
class MatchingRuleCategoryIterator: ...


class MatchingRuleDefinitionResult:
...
class MatchingRuleDefinitionResult: ...


class MatchingRuleIterator:
...
class MatchingRuleIterator: ...


class MatchingRuleKeyValuePair:
...
class MatchingRuleKeyValuePair: ...


class MatchingRuleResult:
...
class MatchingRuleResult: ...


class Message:
...
class Message: ...


class MessageContents:
...
class MessageContents: ...


class MessageHandle:
...
class MessageHandle: ...


class MessageMetadataIterator:
...
class MessageMetadataIterator: ...


class MessageMetadataPair:
...
class MessageMetadataPair: ...


class MessagePact:
...
class MessagePact: ...


class MessagePactHandle:
...
class MessagePactHandle: ...


class MessagePactMessageIterator:
...
class MessagePactMessageIterator: ...


class MessagePactMetadataIterator:
...
class MessagePactMetadataIterator: ...


class MessagePactMetadataTriple:
...
class MessagePactMetadataTriple: ...


class Mismatch:
...
class Mismatch: ...


class Mismatches:
...
class Mismatches: ...


class MismatchesIterator:
...
class MismatchesIterator: ...


class Pact:
...
class Pact: ...


class PactHandle:
Expand Down Expand Up @@ -327,8 +300,7 @@ def port(self) -> int:
return self._ref


class PactInteraction:
...
class PactInteraction: ...


class PactInteractionIterator:
Expand Down Expand Up @@ -535,36 +507,28 @@ def __next__(self) -> SynchronousMessage:
return pact_sync_message_iter_next(self)


class Provider:
...
class Provider: ...


class ProviderState:
...
class ProviderState: ...


class ProviderStateIterator:
...
class ProviderStateIterator: ...


class ProviderStateParamIterator:
...
class ProviderStateParamIterator: ...


class ProviderStateParamPair:
...
class ProviderStateParamPair: ...


class SynchronousHttp:
...
class SynchronousHttp: ...


class SynchronousMessage:
...
class SynchronousMessage: ...


class VerifierHandle:
...
class VerifierHandle: ...


class ExpressionValueType(Enum):
Expand Down
33 changes: 15 additions & 18 deletions pact/v3/pact.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,13 @@ def _parse_interaction_part(
raise ValueError(msg)

@overload
def given(self, state: str) -> Self:
...
def given(self, state: str) -> Self: ...

@overload
def given(self, state: str, *, name: str, value: str) -> Self:
...
def given(self, state: str, *, name: str, value: str) -> Self: ...

@overload
def given(self, state: str, *, parameters: dict[str, Any] | str) -> Self:
...
def given(self, state: str, *, parameters: dict[str, Any] | str) -> Self: ...

def given(
self,
Expand Down Expand Up @@ -1027,24 +1024,21 @@ def upon_receiving(
self,
description: str,
interaction: Literal["HTTP"] = ...,
) -> HttpInteraction:
...
) -> HttpInteraction: ...

@overload
def upon_receiving(
self,
description: str,
interaction: Literal["Async"],
) -> AsyncMessageInteraction:
...
) -> AsyncMessageInteraction: ...

@overload
def upon_receiving(
self,
description: str,
interaction: Literal["Sync"],
) -> SyncMessageInteraction:
...
) -> SyncMessageInteraction: ...

def upon_receiving(
self,
Expand Down Expand Up @@ -1149,19 +1143,22 @@ def messages(self) -> pact.v3.ffi.PactMessageIterator:
return pact.v3.ffi.pact_handle_get_message_iter(self._handle)

@overload
def interactions(self, kind: Literal["HTTP"]) -> pact.v3.ffi.PactSyncHttpIterator:
...
def interactions(
self,
kind: Literal["HTTP"],
) -> pact.v3.ffi.PactSyncHttpIterator: ...

@overload
def interactions(
self,
kind: Literal["Sync"],
) -> pact.v3.ffi.PactSyncMessageIterator:
...
) -> pact.v3.ffi.PactSyncMessageIterator: ...

@overload
def interactions(self, kind: Literal["Async"]) -> pact.v3.ffi.PactMessageIterator:
...
def interactions(
self,
kind: Literal["Async"],
) -> pact.v3.ffi.PactMessageIterator: ...

def interactions(
self,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ test = [
dev = [
"pact-python[types]",
"pact-python[test]",
"black ==23.12.1",
"black ==24.1.1",
"ruff ==0.1.14",
]

Expand Down
12 changes: 6 additions & 6 deletions tests/v3/compatiblity_suite/test_v1_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ def request_n_is_made_to_the_mock_server(
return requests.request(
definition.method,
str(srv.url.with_path(definition.path)),
params=URL.build(query_string=definition.query).query
if definition.query
else None,
params=(
URL.build(query_string=definition.query).query if definition.query else None
),
headers=definition.headers if definition.headers else None, # type: ignore[arg-type]
data=definition.body.bytes if definition.body else None,
)
Expand Down Expand Up @@ -502,9 +502,9 @@ def request_n_is_made_to_the_mock_server_with_the_following_changes(
return requests.request(
definition.method,
str(srv.url.with_path(definition.path)),
params=URL.build(query_string=definition.query).query
if definition.query
else None,
params=(
URL.build(query_string=definition.query).query if definition.query else None
),
headers=definition.headers if definition.headers else None, # type: ignore[arg-type]
data=definition.body.bytes if definition.body else None,
)
Expand Down
1 change: 0 additions & 1 deletion tests/v3/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
directory.
"""


import pytest


Expand Down
1 change: 1 addition & 0 deletions tests/v3/test_ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
They are not intended to test the Pact API itself, as that is handled by the
client library.
"""

import re

import pytest
Expand Down

0 comments on commit 3808404

Please sign in to comment.