2024-10-09 17:08:43 +11:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import unittest
|
|
|
|
|
2024-10-09 18:18:24 +11:00
|
|
|
import pyfroniusreg.froniusreg as froniusreg
|
2024-10-09 17:08:43 +11:00
|
|
|
|
2024-10-09 18:37:45 +11:00
|
|
|
class RegisterValue():
|
|
|
|
def __init__(self, value):
|
|
|
|
self.registers = value
|
|
|
|
|
2024-10-09 18:18:24 +11:00
|
|
|
class TestDataTypes(unittest.TestCase):
|
2024-10-09 17:08:43 +11:00
|
|
|
|
|
|
|
def test_int16(self):
|
2024-10-09 18:37:45 +11:00
|
|
|
value = RegisterValue(froniusreg.int16.encode(1024)[0])
|
|
|
|
assert froniusreg.int16.decode(value) == 1024
|
2024-10-09 17:08:43 +11:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|
|
|
|
|