fix: Rsp.identify NO DATA (пробел); 119 тестов

This commit is contained in:
Repinoid
2026-06-06 07:21:36 +04:00
parent 7aaebf8481
commit 0de7e0591c
2 changed files with 118 additions and 1 deletions
+4 -1
View File
@@ -53,7 +53,10 @@ class Rsp:
def identify(cls, raw: str) -> str:
"""Определяет тип ответа по сырой строке."""
u = raw.upper().strip()
for tag in (cls.SEARCHING, cls.NODATA, cls.ERROR, cls.UNABLE,
# NO DATA бывает как "NODATA" так и "NO DATA"
if u.replace(" ", "") == "NODATA":
return cls.NODATA
for tag in (cls.SEARCHING, cls.ERROR, cls.UNABLE,
cls.BUS_BUSY, cls.BUS_ERROR, cls.CAN_ERROR,
cls.BUS_INIT, cls.STOPPED, cls.DATA_ERROR,
cls.BUFFER_FULL, cls.RX_ERROR, cls.OK):