From 3105428ba1026341b9bc0db58ac30cb7fe14ef2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 20 Dec 2019 09:24:06 +0000 Subject: [PATCH] tests: fix data parse for hidpp index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe LaĆ­ns --- data/devices/data-parse-test.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/data/devices/data-parse-test.py b/data/devices/data-parse-test.py index 04aa86f7..1fbe18b2 100755 --- a/data/devices/data-parse-test.py +++ b/data/devices/data-parse-test.py @@ -138,9 +138,8 @@ def check_section_hidpp10(section): pass try: - index = int(section['DeviceIndex']) - # 10 is arbitrarily chosen - assert(index > 0 and index < 10) + index = int(section['DeviceIndex'], 16) + assert(index > 0 and index <= 0xff) except KeyError: pass @@ -175,9 +174,8 @@ def check_section_hidpp20(section): assertIn(key, permitted) try: - index = int(section['DeviceIndex']) - # 10 is arbitrarily chosen - assert(index > 0 and index < 10) + index = int(section['DeviceIndex'], 16) + assert(index > 0 and index <= 0xff) except KeyError: pass