💚 Add more tests for firmware info splitting

Part of #3916
This commit is contained in:
cp2004 committed 2021-02-22 18:34:15 +00:00
1 parent d0f6bf3e06
commit e43f4ddb50
1 file changed
+19
+19
View File
@@ -376,6 +376,25 @@ class TestCommHelpers(unittest.TestCase):
"UUID": "00000000-0000-0000-0000-000000000000",
},
),
# Test firmware name with time created
(
"FIRMWARE_NAME:Marlin 2.0.7.2 (Nov 27 2020 14:30:11) SOURCE_CODE_URL:https://github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:Ender 5 Pro EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff",
{
"FIRMWARE_NAME": "Marlin 2.0.7.2 (Nov 27 2020 14:30:11)",
"SOURCE_CODE_URL": "https://github.com/MarlinFirmware/Marlin",
"PROTOCOL_VERSION": "1.0",
"MACHINE_TYPE": "Ender 5 Pro",
"EXTRUDER_COUNT": "1",
"UUID": "cede2a2f-41a2-4748-9b12-c55c62f367ff",
}
),
# Test that keys beginning with _ or number are ignored
(
"KEY1:VALUE1 _KEY2:INVALID 123:INVALID",
{
"KEY1": "VALUE1 _", "KEY2": "INVALID 123:INVALID"
}
)
)
@unpack
def test_parse_firmware_line(self, line, expected):