Test writing an event
(self, tmp_path)
| 269 | """Tests for TraceWriter class""" |
| 270 | |
| 271 | def test_write_event(self, tmp_path): |
| 272 | """Test writing an event""" |
| 273 | path = tmp_path / "trace.jsonl" |
| 274 | writer = TraceWriter(path) |
| 275 | |
| 276 | writer.write({"type": "test", "data": "value"}) |
| 277 | |
| 278 | with open(path) as f: |
| 279 | loaded = json.loads(f.readline()) |
| 280 | assert loaded["type"] == "test" |
| 281 | assert loaded["data"] == "value" |
| 282 | |
| 283 | def test_write_multiple_events(self, tmp_path): |
| 284 | """Test writing multiple events""" |
nothing calls this directly
no test coverage detected