Skip to content

Commit

Permalink
Parse session state in API responses
Browse files Browse the repository at this point in the history
  • Loading branch information
smkent committed Feb 20, 2023
1 parent 7109284 commit f417a88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions jmapc/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def _response_type(method_name: str) -> Type[ResponseOrError]:

@dataclass
class APIResponse(Model):
session_state: str
method_responses: List[InvocationResponseOrError] = field(
metadata=config(
encoder=lambda value: None,
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def expect_jmap_call(
expected_request: Dict[str, Any],
response: Dict[str, Any],
) -> None:
response.setdefault("sessionState", "test;session;state")
http_responses.add_callback(
method=responses.POST,
url="https://jmap-api.localhost/api",
Expand Down

0 comments on commit f417a88

Please sign in to comment.