31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
from pathlib import Path
|
|
|
|
from pygui.backend.data.file_browser import FileBrowser
|
|
|
|
|
|
def _write_csv(path, wafer_id="P00001"):
|
|
path.write_text(
|
|
f"Wafer ID={wafer_id}\n"
|
|
"Acquisition Date=03/26/2025\n"
|
|
"Label,1,2,3\n"
|
|
"X (mm),0,10,-10\n"
|
|
"Y (mm),10,-10,-10\n"
|
|
"data\n"
|
|
"0.0,149.0,148.5,150.6\n"
|
|
)
|
|
|
|
|
|
def test_recorded_live_file_flagged_as_recording(qapp, tmp_path):
|
|
"""Files named live_<serial>_<timestamp>.csv (SessionController.startRecording)
|
|
must be distinguishable in the browser from read-memory dumps."""
|
|
_write_csv(tmp_path / "live_P00001_20260706_143022.csv")
|
|
_write_csv(tmp_path / "P00002-20260706_143500.csv")
|
|
|
|
browser = FileBrowser()
|
|
browser._set_current_directory(tmp_path)
|
|
browser.refreshFiles()
|
|
|
|
files_by_name = {Path(row["fileName"]).name: row for row in browser.files}
|
|
assert files_by_name["live_P00001_20260706_143022.csv"]["isRecording"] is True
|
|
assert files_by_name["P00002-20260706_143500.csv"]["isRecording"] is False
|