|
|
@@ -340,6 +340,24 @@ def api_tests() -> None:
|
|
|
check("full: parse_export skips INF",
|
|
|
all(_math.isfinite(v) for v in flat_vals))
|
|
|
|
|
|
+ # Node Temperatures 4-column layout: "node_id;name;value;unit" must be
|
|
|
+ # remapped to (name, value, unit) - regression for 2026-09-04 user report
|
|
|
+ # where headers became "0[25]" and data cells held part names.
|
|
|
+ nt_csv = Path(tempfile.mkdtemp()) / "node_temps.csv"
|
|
|
+ nt_csv.write_text(
|
|
|
+ "Node Temperatures\n"
|
|
|
+ "0;\"Ambient\";25;\u00b0C\n"
|
|
|
+ "1;\"Housing\";39.99;\u00b0C\n",
|
|
|
+ encoding="utf-8",
|
|
|
+ )
|
|
|
+ nt_rows = parse_export_full(nt_csv)
|
|
|
+ check("full: node temps remapped",
|
|
|
+ nt_rows[0]["name"] == "Ambient"
|
|
|
+ and nt_rows[0]["value"] == 25.0
|
|
|
+ and nt_rows[0]["unit"] == "\u00b0C")
|
|
|
+ check("full: node temps no id leak",
|
|
|
+ all(r["name"] != "0" for r in nt_rows))
|
|
|
+
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
unit_tests()
|