From fa16037e9a2445c701d7aa2f8d5e121d46e077f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 9 Mar 2017 16:39:16 +0100 Subject: [PATCH] Unit test for M115 response parsing --- tests/util/test_comm_helpers.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/util/test_comm_helpers.py b/tests/util/test_comm_helpers.py index a8870c28..762ac728 100644 --- a/tests/util/test_comm_helpers.py +++ b/tests/util/test_comm_helpers.py @@ -237,3 +237,12 @@ class TestCommHelpers(unittest.TestCase): result = canonicalize_temperatures(parsed, current) self.assertDictEqual(expected, result) + @data( + ("KEY1:Value 1 FIRMWARE_NAME:Some Firmware With Spaces KEY2:Value 2", + dict(KEY1="Value 1", KEY2="Value 2", FIRMWARE_NAME="Some Firmware With Spaces")) + ) + @unpack + def test_parse_firmware_line(self, line, expected): + from octoprint.util.comm import parse_firmware_line + result = parse_firmware_line(line) + self.assertDictEqual(expected, result)