summaryrefslogtreecommitdiffstats
path: root/test/test_otultraeasy.py
blob: 2e1b093a9f547ad3bef28747e8bb7198c1d8eccc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -*-
"""Tests for the LifeScan OneTouch Ultra Easy driver."""

__author__ = 'Diego Elio Pettenò'
__email__ = 'flameeyes@flameeyes.eu'
__copyright__ = 'Copyright © 2018, Diego Elio Pettenò'
__license__ = 'MIT'

# pylint: disable=protected-access,missing-docstring

from absl.testing import absltest

from glucometerutils.drivers import otultraeasy


class ConstructTest(absltest.TestCase):

    def test_make_packet_ack(self):
        self.assertEqual(
            b'\x02\x06\x08\x03\xc2\x62',
            otultraeasy._make_packet(b'', False, False, False, True))

    def test_make_packet_version_request(self):
        self.assertEqual(
            b'\x02\x09\x03\x05\x0d\x02\x03\x08\x9f',
            otultraeasy._make_packet(
                b'\x05\x0d\x02', True, True, False, False))