Skip to content

Commit

Permalink
Remove revision padding
Browse files Browse the repository at this point in the history
  • Loading branch information
kg583 committed Jan 13, 2024
1 parent a1db9cd commit bb876ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/tivars.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
2 changes: 1 addition & 1 deletion tivars/flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bb876ad

Please sign in to comment.