From a5a60d9c4bc6423ec5e68fb0c20a997dce245c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Thu, 16 May 2019 21:37:34 +0100 Subject: freestyle support: restore correct order of parameters. Also add a test so that we don't break this again in the future. --- test/test_freestyle.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/test_freestyle.py (limited to 'test/test_freestyle.py') diff --git a/test/test_freestyle.py b/test/test_freestyle.py new file mode 100644 index 0000000..0ff669d --- /dev/null +++ b/test/test_freestyle.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# +# SPDX-License-Identifier: MIT +"""Tests for the common FreeStyle functions..""" + +# pylint: disable=protected-access,missing-docstring + +from absl.testing import absltest + +from glucometerutils.support import freestyle + + +class TestFreeStyle(absltest.TestCase): + + def test_outgoing_command(self): + """Test the generation of a new outgoing message.""" + + self.assertEqual( + b'\0\x17\7command\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' + b'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', + freestyle._FREESTYLE_MESSAGE.build( + {'message_type': 23, 'command': b'command'}), + ) -- cgit v1.2.3