fix!: set packet version to 0.7 by default
no more unknown version that could break things
This commit is contained in:
parent
aef93ce88b
commit
59d0150ed2
|
@ -14,10 +14,8 @@ def test_pack_handmade_count_connless7() -> None:
|
||||||
|
|
||||||
packet2 = parse7(data)
|
packet2 = parse7(data)
|
||||||
|
|
||||||
# TODO: this should not fail ideally
|
assert packet.version == packet2.version
|
||||||
# the version fiels is set to unknown for one of them
|
assert vars(packet.messages[0]) == vars(packet2.messages[0])
|
||||||
# other fields probably also missmatch
|
|
||||||
# assert vars(packet) == vars(packet2)
|
|
||||||
|
|
||||||
assert len(packet2.messages) == 1
|
assert len(packet2.messages) == 1
|
||||||
assert packet2.messages[0].message_name == 'connless.count'
|
assert packet2.messages[0].message_name == 'connless.count'
|
||||||
|
|
|
@ -192,8 +192,8 @@ class PacketHeader(PrettyPrint):
|
||||||
]) + self.token
|
]) + self.token
|
||||||
|
|
||||||
class TwPacket(PrettyPrint):
|
class TwPacket(PrettyPrint):
|
||||||
def __init__(self) -> None:
|
def __init__(self, version: str = '0.7') -> None:
|
||||||
self.version: str = 'unknown'
|
self.version: str = version
|
||||||
self.payload_raw: bytes = b''
|
self.payload_raw: bytes = b''
|
||||||
self.payload_decompressed: bytes = b''
|
self.payload_decompressed: bytes = b''
|
||||||
self.header: Union[PacketHeader, PacketHeader6] = PacketHeader()
|
self.header: Union[PacketHeader, PacketHeader6] = PacketHeader()
|
||||||
|
|
Loading…
Reference in a new issue