summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.com>2019-05-16 22:37:34 +0200
committerDiego Elio Pettenò <flameeyes@flameeyes.com>2019-05-16 22:37:34 +0200
commita5a60d9c4bc6423ec5e68fb0c20a997dce245c96 (patch)
treeabb6e441233e67e0e5c2ff369ce216f872481f9b /test
parentnew line at end of .gitignore, rename arresult entry map (diff)
downloadglucometerutils-a5a60d9c4bc6423ec5e68fb0c20a997dce245c96.tar
glucometerutils-a5a60d9c4bc6423ec5e68fb0c20a997dce245c96.tar.gz
glucometerutils-a5a60d9c4bc6423ec5e68fb0c20a997dce245c96.tar.bz2
glucometerutils-a5a60d9c4bc6423ec5e68fb0c20a997dce245c96.tar.lz
glucometerutils-a5a60d9c4bc6423ec5e68fb0c20a997dce245c96.tar.xz
glucometerutils-a5a60d9c4bc6423ec5e68fb0c20a997dce245c96.tar.zst
glucometerutils-a5a60d9c4bc6423ec5e68fb0c20a997dce245c96.zip
Diffstat (limited to 'test')
-rw-r--r--test/test_freestyle.py23
1 files changed, 23 insertions, 0 deletions
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'}),
+ )