summaryrefslogtreecommitdiffstats
path: root/test/test_otultra2.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_otultra2.py')
-rw-r--r--test/test_otultra2.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_otultra2.py b/test/test_otultra2.py
index 5007ca7..4d59f6a 100644
--- a/test/test_otultra2.py
+++ b/test/test_otultra2.py
@@ -30,6 +30,14 @@ class TestOTUltra2(unittest.TestCase):
def _set_return_string(self, string):
self.mock_readline.return_value = bytes(string, 'ascii')
+ def test_checksum(self):
+ checksum = otultra2._calculate_checksum(bytes('T', 'ascii'))
+ self.assertEqual(0x0054, checksum)
+
+ checksum = otultra2._calculate_checksum(
+ bytes('T "SAT","08/03/13","22:12:00 "', 'ascii'))
+ self.assertEqual(0x0608, checksum)
+
def test_missing_checksum(self):
self._set_return_string('INVALID')