feat: add FIT CRC calculation
This commit is contained in:
11
tests/fit/test_crc.py
Normal file
11
tests/fit/test_crc.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from app.fit.crc import fit_crc
|
||||
|
||||
|
||||
def test_empty_crc_is_zero() -> None:
|
||||
assert fit_crc(b"") == 0
|
||||
|
||||
|
||||
def test_crc_is_incremental_equivalent() -> None:
|
||||
payload = b".FIT-device-metadata"
|
||||
assert fit_crc(payload) == fit_crc(memoryview(payload))
|
||||
assert 0 <= fit_crc(payload) <= 0xFFFF
|
||||
Reference in New Issue
Block a user