From 4d3c59f2b5bf1e3afc620b12370be16db36a3688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Thu, 3 Aug 2023 00:38:53 +0100 Subject: Be more verbose on error messages and parsing with construct. Instead of manually combining and parsing integers (particularly IV that is a 56-bit integer), use construct formats to handle the parsing. --- freestyle_hid/tests/test_freestyle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'freestyle_hid/tests/test_freestyle.py') diff --git a/freestyle_hid/tests/test_freestyle.py b/freestyle_hid/tests/test_freestyle.py index feb7c15..ebf6b80 100644 --- a/freestyle_hid/tests/test_freestyle.py +++ b/freestyle_hid/tests/test_freestyle.py @@ -14,9 +14,9 @@ class TestFreeStyle(unittest.TestCase): """Test the generation of a new outgoing message.""" self.assertEqual( - b"\0\x17\7command\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + b"\x17\7command\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", _session._FREESTYLE_MESSAGE.build( - {"message_type": 23, "command": b"command"} + {"message_type": 23, "command": b"command", "mac": 0} ), ) -- cgit v1.2.3