summaryrefslogtreecommitdiffstats
path: root/test/test_lifescan.py
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2013-08-03 22:28:43 +0200
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2013-08-03 22:28:43 +0200
commitf7fde8b5a659b5b7de7d00cddb28c20d3c691d37 (patch)
treee97fc56403c13ea8f21e6cb4243d50d83ae9bacd /test/test_lifescan.py
parentglucometer: remove unused argv usage. (diff)
downloadglucometerutils-f7fde8b5a659b5b7de7d00cddb28c20d3c691d37.tar
glucometerutils-f7fde8b5a659b5b7de7d00cddb28c20d3c691d37.tar.gz
glucometerutils-f7fde8b5a659b5b7de7d00cddb28c20d3c691d37.tar.bz2
glucometerutils-f7fde8b5a659b5b7de7d00cddb28c20d3c691d37.tar.lz
glucometerutils-f7fde8b5a659b5b7de7d00cddb28c20d3c691d37.tar.xz
glucometerutils-f7fde8b5a659b5b7de7d00cddb28c20d3c691d37.tar.zst
glucometerutils-f7fde8b5a659b5b7de7d00cddb28c20d3c691d37.zip
Diffstat (limited to 'test/test_lifescan.py')
-rw-r--r--test/test_lifescan.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/test_lifescan.py b/test/test_lifescan.py
new file mode 100644
index 0000000..774567d
--- /dev/null
+++ b/test/test_lifescan.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+"""Tests for the LifeScan Common functions."""
+
+__author__ = 'Diego Elio Pettenò'
+__email__ = 'flameeyes@flameeyes.eu'
+__copyright__ = 'Copyright © 2013, Diego Elio Pettenò'
+__license__ = 'GPL v3 or later'
+
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+from glucometerutils import common
+from glucometerutils.drivers import lifescan_common
+from glucometerutils import exceptions
+
+
+class TestOTUltra2(unittest.TestCase):
+ def testChecksum(self):
+ checksum = lifescan_common.calculate_checksum(bytes('T', 'ascii'))
+ self.assertEqual(0x5400, checksum)
+
+ checksum = lifescan_common.calculate_checksum(bytes('TestString', 'ascii'))
+ self.assertEqual(0x0643, checksum)
+
+if __name__ == '__main__':
+ unittest.main()