Replay Tabs:
- Add stability detection and threshold classification features with corresponding tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""Tests for serialcomm/data_parser.py binary parsing pipeline."""
|
||||
|
||||
import pytest
|
||||
from serialcomm.data_parser import (
|
||||
from pygui.serialcomm.data_parser import (
|
||||
csv_column_count,
|
||||
parse_binary_data,
|
||||
convert_to_temperatures,
|
||||
@@ -12,7 +12,6 @@ from serialcomm.data_parser import (
|
||||
MAXDUT_X,
|
||||
)
|
||||
|
||||
|
||||
# ── csv_column_count ──────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -203,6 +202,7 @@ class TestConvertToTemperatures:
|
||||
def test_p_family_single_block(self):
|
||||
data = _make_p_block(1, value=0x0100)
|
||||
hex_data = parse_binary_data(data, "P")
|
||||
assert hex_data is not None
|
||||
result = convert_to_temperatures(hex_data, "P")
|
||||
assert len(result) == 1
|
||||
assert all(isinstance(v, str) for v in result[0])
|
||||
@@ -270,9 +270,9 @@ class TestSaveToCsv:
|
||||
result = save_to_csv(data, family, f"{family}00001", str(tmp_path))
|
||||
assert result is not None, f"save_to_csv returned None for {family}"
|
||||
headers = open(result).readline().strip().split(",")
|
||||
assert len(headers) == expected_cols, (
|
||||
f"{family}: expected {expected_cols} headers, got {len(headers)}"
|
||||
)
|
||||
assert (
|
||||
len(headers) == expected_cols
|
||||
), f"{family}: expected {expected_cols} headers, got {len(headers)}"
|
||||
assert headers[0] == "Sensor1"
|
||||
assert headers[-1] == f"Sensor{expected_cols}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user