From bb876ad0114842aec0587e446db3e41e0ef8cfdd Mon Sep 17 00:00:00 2001 From: KG Date: Sat, 13 Jan 2024 12:31:56 -0500 Subject: [PATCH] Remove revision padding --- tests/tivars.py | 3 ++- tivars/flash.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/tivars.py b/tests/tivars.py index 328d8ec..49d230c 100644 --- a/tests/tivars.py +++ b/tests/tivars.py @@ -597,7 +597,7 @@ def test_app(self): def test_os(self): test_os = TIFlashHeader.open("tests/data/var/TI-84_Plus_CE-Python-OS-5.8.0.0022.8eu") - self.assertEqual(test_os.magic, "**TIFL**") + self.assertEqual(test_os.revision, "5.8") self.assertEqual(test_os.object_type, 0x00) self.assertEqual(test_os.product_id, 0x13) self.assertEqual(type(test_os), TIOperatingSystem) @@ -608,6 +608,7 @@ def test_os(self): def test_license(self): test_license = TILicense.open("tests/data/var/ti89_2.01_10-13-1999.89u") + self.assertEqual(test_license.magic, "**TIFL**") self.assertEqual(test_license.date, (12, 10, 1999)) self.assertEqual(test_license.devices, [(0x74, 0x3E), (0x73, 0x3E), (0x98, 0x3E), (0x88, 0x3E)]) self.assertEqual(test_license.license.split("\r\n")[2], "Texas Instruments License Agreement") diff --git a/tivars/flash.py b/tivars/flash.py index c89263e..901fbe3 100644 --- a/tivars/flash.py +++ b/tivars/flash.py @@ -77,7 +77,7 @@ def get(cls, data: bytes, **kwargs) -> _T: :return: The revision number stored in ``data`` """ - return f"{BCD.get(data[0:1])}.{BCD.get(data[1:2]):02}" + return f"{BCD.get(data[0:1])}.{BCD.get(data[1:2])}" @classmethod def set(cls, value: _T, **kwargs) -> bytes: