Skip to content

Commit

Permalink
More union fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed Sep 18, 2023
1 parent 42b8d05 commit f495345
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions pythonFiles/unittestadapter/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PayloadDict(TypedDict):
class EOTPayloadDict(TypedDict):
"""A dictionary that is used to send a end of transmission post request to the server."""

command_type: Literal["discovery"] | Literal["execution"]
command_type: Union[Literal["discovery"], Literal["execution"]]
eot: bool


Expand Down Expand Up @@ -113,7 +113,9 @@ def discover_tests(
return payload


def post_response(payload: PayloadDict | EOTPayloadDict, port: int, uuid: str) -> None:
def post_response(
payload: Union[PayloadDict, EOTPayloadDict], port: int, uuid: str
) -> None:
# Build the request data (it has to be a POST request or the Node side will not process it), and send it.
addr = ("localhost", port)
data = json.dumps(payload)
Expand Down
6 changes: 4 additions & 2 deletions pythonFiles/unittestadapter/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class PayloadDict(TypedDict):
class EOTPayloadDict(TypedDict):
"""A dictionary that is used to send a end of transmission post request to the server."""

command_type: Literal["discovery"] | Literal["execution"]
command_type: Union[Literal["discovery"], Literal["execution"]]
eot: bool


Expand Down Expand Up @@ -250,7 +250,9 @@ def send_run_data(raw_data, port, uuid):
post_response(payload, port, uuid)


def post_response(payload: PayloadDict | EOTPayloadDict, port: int, uuid: str) -> None:
def post_response(
payload: Union[PayloadDict, EOTPayloadDict], port: int, uuid: str
) -> None:
# Build the request data (it has to be a POST request or the Node side will not process it), and send it.
addr = ("localhost", port)
global __socket
Expand Down

0 comments on commit f495345

Please sign in to comment.