diff options
author | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2018-01-01 15:48:16 +0100 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2018-01-01 15:48:16 +0100 |
commit | 60eef1be7ebfce29b79f2eb88e076c63cd0290e3 (patch) | |
tree | de56dfe2fc386a5e2833f6961360f169485c11c1 /test/test_otultraeasy.py | |
parent | otverio2015: reorder functions to match otultraeasy. (diff) | |
download | glucometerutils-60eef1be7ebfce29b79f2eb88e076c63cd0290e3.tar glucometerutils-60eef1be7ebfce29b79f2eb88e076c63cd0290e3.tar.gz glucometerutils-60eef1be7ebfce29b79f2eb88e076c63cd0290e3.tar.bz2 glucometerutils-60eef1be7ebfce29b79f2eb88e076c63cd0290e3.tar.lz glucometerutils-60eef1be7ebfce29b79f2eb88e076c63cd0290e3.tar.xz glucometerutils-60eef1be7ebfce29b79f2eb88e076c63cd0290e3.tar.zst glucometerutils-60eef1be7ebfce29b79f2eb88e076c63cd0290e3.zip |
Diffstat (limited to 'test/test_otultraeasy.py')
-rw-r--r-- | test/test_otultraeasy.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/test/test_otultraeasy.py b/test/test_otultraeasy.py deleted file mode 100644 index 52a98f1..0000000 --- a/test/test_otultraeasy.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -"""Tests for the LifeScan OneTouch Ultra Mini driver.""" - -__author__ = 'Diego Elio Pettenò' -__email__ = 'flameeyes@flameeyes.eu' -__copyright__ = 'Copyright © 2013-2017, Diego Elio Pettenò' -__license__ = 'MIT' - -import array -import os -import sys -import unittest -from unittest import mock - -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - -from glucometerutils.drivers import otultraeasy -from glucometerutils.support import lifescan -from glucometerutils import exceptions - -class TestOTUltraMini(unittest.TestCase): - def setUp(self): - self.addCleanup(mock.patch.stopall) - - mock_serial = mock.patch('serial.Serial').start() - self.mock_readline = mock_serial.return_value.readline - - self.device = otultraeasy.Device('mockdevice') - - def test_crc(self): - self.assertEqual( - 0x41cd, - lifescan.crc_ccitt(b'\x02\x06\x06\x03')) - - def test_crc_array(self): - cmd_array = array.array('B', b'\x02\x06\x08\x03') - self.assertEqual( - 0x62C2, - lifescan.crc_ccitt(cmd_array)) - - -if __name__ == '__main__': - unittest.main() |