Loading kilter/protocol/messages.py +2 −2 Original line number Diff line number Diff line Loading @@ -423,10 +423,10 @@ class Macro(Message, ident=b"D"): A message type for transferring symbol mappings prior to a stage event """ stage: bytes stage: int macros: Mapping[str, str] _struct = Struct("!c") _struct = Struct("!B") @classmethod def from_buffer(cls, buf: memoryview) -> Self: Loading tests/test_core_filter_protocol.py +2 −2 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class FilterProtocolTests(unittest.TestCase): # Prepare input messages buf = SimpleBuffer(100) Negotiate(6, ALL_ACTION_FLAGS, ALL_PROTOCOL_FLAGS).pack(buf) Macro(b"\x00", dict(spam="ham")).pack(buf) Macro(0, dict(spam="ham")).pack(buf) Connect("example.com", IPv4Address("10.1.1.1"), 11111).pack(buf) protocol = FilterProtocol() Loading Loading @@ -96,7 +96,7 @@ class FilterProtocolTests(unittest.TestCase): # Prepare input messages buf = SimpleBuffer(100) Negotiate(6, ALL_ACTION_FLAGS, ALL_PROTOCOL_FLAGS).pack(buf) Macro(b"\x00", dict(spam="ham")).pack(buf) Macro(0, dict(spam="ham")).pack(buf) Connect("example.com", IPv4Address("10.1.1.1"), 11111).pack(buf) with self.assertRaises(UnexpectedMessage): Loading tests/test_messages.py +6 −6 Original line number Diff line number Diff line Loading @@ -340,18 +340,18 @@ class MacroMessageTests( Return test values for generic message tests, appropriate for Macro """ yield ( (b"C", {}), dict(), dict(stage=b"C", macros=dict()), (ord("C"), {}), dict(), dict(stage=ord("C"), macros=dict()), b"C", ) yield ( (b"H",), dict(macros=dict(spam="ham", eggs="green")), dict(stage=b"H", macros=dict(spam="ham", eggs="green")), (ord("H"),), dict(macros=dict(spam="ham", eggs="green")), dict(stage=ord("H"), macros=dict(spam="ham", eggs="green")), b"Hspam\x00ham\x00eggs\x00green\x00", ) yield ( tuple(), dict(stage=b"M", macros=dict(spam="ham", eggs="green")), dict(stage=b"M", macros=dict(spam="ham", eggs="green")), tuple(), dict(stage=ord("M"), macros=dict(spam="ham", eggs="green")), dict(stage=ord("M"), macros=dict(spam="ham", eggs="green")), b"Mspam\x00ham\x00eggs\x00green\x00", ) Loading Loading
kilter/protocol/messages.py +2 −2 Original line number Diff line number Diff line Loading @@ -423,10 +423,10 @@ class Macro(Message, ident=b"D"): A message type for transferring symbol mappings prior to a stage event """ stage: bytes stage: int macros: Mapping[str, str] _struct = Struct("!c") _struct = Struct("!B") @classmethod def from_buffer(cls, buf: memoryview) -> Self: Loading
tests/test_core_filter_protocol.py +2 −2 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class FilterProtocolTests(unittest.TestCase): # Prepare input messages buf = SimpleBuffer(100) Negotiate(6, ALL_ACTION_FLAGS, ALL_PROTOCOL_FLAGS).pack(buf) Macro(b"\x00", dict(spam="ham")).pack(buf) Macro(0, dict(spam="ham")).pack(buf) Connect("example.com", IPv4Address("10.1.1.1"), 11111).pack(buf) protocol = FilterProtocol() Loading Loading @@ -96,7 +96,7 @@ class FilterProtocolTests(unittest.TestCase): # Prepare input messages buf = SimpleBuffer(100) Negotiate(6, ALL_ACTION_FLAGS, ALL_PROTOCOL_FLAGS).pack(buf) Macro(b"\x00", dict(spam="ham")).pack(buf) Macro(0, dict(spam="ham")).pack(buf) Connect("example.com", IPv4Address("10.1.1.1"), 11111).pack(buf) with self.assertRaises(UnexpectedMessage): Loading
tests/test_messages.py +6 −6 Original line number Diff line number Diff line Loading @@ -340,18 +340,18 @@ class MacroMessageTests( Return test values for generic message tests, appropriate for Macro """ yield ( (b"C", {}), dict(), dict(stage=b"C", macros=dict()), (ord("C"), {}), dict(), dict(stage=ord("C"), macros=dict()), b"C", ) yield ( (b"H",), dict(macros=dict(spam="ham", eggs="green")), dict(stage=b"H", macros=dict(spam="ham", eggs="green")), (ord("H"),), dict(macros=dict(spam="ham", eggs="green")), dict(stage=ord("H"), macros=dict(spam="ham", eggs="green")), b"Hspam\x00ham\x00eggs\x00green\x00", ) yield ( tuple(), dict(stage=b"M", macros=dict(spam="ham", eggs="green")), dict(stage=b"M", macros=dict(spam="ham", eggs="green")), tuple(), dict(stage=ord("M"), macros=dict(spam="ham", eggs="green")), dict(stage=ord("M"), macros=dict(spam="ham", eggs="green")), b"Mspam\x00ham\x00eggs\x00green\x00", ) Loading