int16 decode test

This commit is contained in:
Paul Warren 2024-10-16 19:54:24 +11:00
parent fec99b0fe8
commit 5db75db8cb

View file

@ -9,6 +9,10 @@ class TestDataTypes(unittest.TestCase):
int16_buffer = froniusreg.int16.encode_to_buffer(1024)
assert int16_buffer == [b"\x04\x00"]
def test_int16_decode(self):
int16_register = [0x0, 0x1, 0x0, 0x0, 0x0, 0x5, 0x1, 0x3, 0x2, 0x0, 0x0]
output = froniusreg.int16.decode_from_register(int16_register)
assert output == 0
if __name__ == "__main__":
unittest.main()