2023-04-07 12:31:04 +00:00
|
|
|
from twnet_parser.packet import parse7
|
|
|
|
|
|
|
|
def test_parse_7_real_call_vote():
|
|
|
|
packet = parse7(b'\x02\x7e\x01\x48\x1f\x93\xd7' \
|
|
|
|
b'\x40\x10\x0a' \
|
|
|
|
b'\x80\x01' \
|
|
|
|
b'\x6f\x70\x74\x69\x6f\x6e\x00' \
|
|
|
|
b'\x74\x65\x73\x74\x00' \
|
|
|
|
b'\x00' \
|
|
|
|
b'\x00')
|
|
|
|
|
|
|
|
assert packet.version == '0.7'
|
|
|
|
|
|
|
|
assert packet.header.token == b'\x48\x1f\x93\xd7'
|
|
|
|
assert packet.header.num_chunks == 1
|
|
|
|
assert packet.header.ack == 638
|
|
|
|
|
|
|
|
assert packet.header.flags.control is False
|
|
|
|
assert packet.header.flags.compression is False
|
|
|
|
|
|
|
|
assert len(packet.messages) == 1
|
|
|
|
|
|
|
|
msg = packet.messages[0]
|
|
|
|
|
|
|
|
assert msg.message_name == 'cl_call_vote'
|
|
|
|
|
2023-04-07 14:10:56 +00:00
|
|
|
assert msg.type == 'option'
|
2023-04-07 12:31:04 +00:00
|
|
|
assert msg.value == 'test'
|
|
|
|
assert msg.reason == ''
|
|
|
|
assert msg.force == False
|