Skip to content

Commit 0e0d094

Browse files
committed
test(split_command): test splitted command
make sure that we have same command after collecting splitted parts
1 parent 67595a1 commit 0e0d094

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/unit/test_lite.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def test_generator(target_length):
3232
)
3333
def test_split_command(command: bytearray):
3434
tion = TionLiteFamily(mac="")
35-
splitted = tion.split_command(request=command)
35+
splitted = tion.split_command(request=command.copy())
36+
joined = bytearray()
3637

3738
for i in range(len(splitted)):
3839
assert len(splitted[i]) <= 20
@@ -45,6 +46,8 @@ def test_split_command(command: bytearray):
4546
assert splitted[i][0] == TionLiteFamily.END_PACKET_ID
4647
else:
4748
assert splitted[i][0] == TionLiteFamily.MIDDLE_PACKET_ID
49+
joined += splitted[i][1:]
4850

51+
assert command[1:] == joined
4952

5053

0 commit comments

Comments
 (0)