Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Mar 28, 2024
1 parent b0a8110 commit e6008aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mqtt_ros_bridge/encodings.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import Protocol, Type, TypeVar, NoReturn
from typing import Protocol, Type, TypeVar, NoReturn, TypeAlias

import json
from rclpy.type_support import check_is_valid_msg_type


NestedDictionary = dict[str, 'NestedDictionary'] | dict[str, str] | dict[str, NoReturn]
NestedDictionary: TypeAlias = dict[str, 'NestedDictionary'] | dict[str, str] | dict[str, NoReturn]


class MsgLike(Protocol):
Expand Down
4 changes: 3 additions & 1 deletion test/test_encodings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@


def encodings_helper(msg: MsgLikeT) -> MsgLikeT:
assert human_readable_decoding(human_readable_encoding(msg), type(msg)) == msg
encoded_and_decoded_msg = human_readable_decoding(human_readable_encoding(msg), type(msg))
assert encoded_and_decoded_msg == msg
return encoded_and_decoded_msg


def test_encodings() -> None:
Expand Down

0 comments on commit e6008aa

Please sign in to comment.