Test apply_to with rewrite.
(self, data_item)
| 239 | assert kept is not None |
| 240 | |
| 241 | def test_apply_to_rewrite(self, data_item): |
| 242 | """Test apply_to with rewrite.""" |
| 243 | original_answer = data_item.get_answer(0) |
| 244 | |
| 245 | result = Result(item_idx=0) |
| 246 | result.add_rewrite(qa_idx=0, new_answer="Rewritten answer", message="M") |
| 247 | |
| 248 | kept, rejected = result.apply_to(data_item, op_name="TestRewriter") |
| 249 | |
| 250 | # Answer should be changed |
| 251 | if kept is not None: |
| 252 | assert kept.get_answer(0) == "Rewritten answer" |
| 253 | |
| 254 | def test_apply_to_global_rejection(self, data_item): |
| 255 | """Test apply_to with global rejection (qa_idx=-1).""" |
nothing calls this directly
no test coverage detected