Test creating replayer from file
(self, tmp_path)
| 144 | """Tests for TraceReplayer class""" |
| 145 | |
| 146 | def test_from_file(self, tmp_path): |
| 147 | """Test creating replayer from file""" |
| 148 | path = tmp_path / "trace.jsonl" |
| 149 | events = [ |
| 150 | { |
| 151 | "type": "llm_response", |
| 152 | "step_id": "1", |
| 153 | "iteration": 0, |
| 154 | "content": "Hello", |
| 155 | }, |
| 156 | ] |
| 157 | |
| 158 | with open(path, "w") as f: |
| 159 | for event in events: |
| 160 | f.write(json.dumps(event) + "\n") |
| 161 | |
| 162 | replayer = TraceReplayer.from_file(path) |
| 163 | assert replayer._events == events |
| 164 | |
| 165 | def test_next_llm_message(self, tmp_path): |
| 166 | """Test getting next LLM message""" |