from pathlib import Path from sfm.waveform_store import WaveformStore _FIX = Path(__file__).parent / "fixtures/histogram-extension-re/events-5-21-26/K558LL8B.7I0W" def test_save_imported_bw_attaches_shape(tmp_path): store = WaveformStore(tmp_path / "waveforms") ev, rec = store.save_imported_bw(_FIX.read_bytes(), source_path=_FIX, serial_hint="BE9558") assert rec.get("shape_axis") in ("Tran", "Vert", "Long") assert rec["shape_crest_factor"] > 0 assert rec["shape_sample_count"] > 200