()
| 485 | def test_evidence_tool_write_get_list_search_delete(self): |
| 486 | |
| 487 | async def main(): |
| 488 | with tempfile.TemporaryDirectory() as td: |
| 489 | cfg = _make_config( |
| 490 | td, tools={'evidence_store': SimpleNamespace()}) |
| 491 | tool = EvidenceTool(cfg) |
| 492 | await tool.connect() |
| 493 | |
| 494 | tools = await tool.get_tools() |
| 495 | self.assertIn('evidence_store', tools) |
| 496 | |
| 497 | res = await tool.write_note( |
| 498 | title='Finding A', |
| 499 | content='Claim A. Support A', |
| 500 | sources=[{ |
| 501 | 'url': 'https://example.com/src', |
| 502 | 'published_at': '2026-01-01', |
| 503 | 'source_tier': 'primary', |
| 504 | }], |
| 505 | summary='summary A', |
| 506 | task_id='task_1', |
| 507 | tags=['tag1', 'tag2'], |
| 508 | quality_score=80, |
| 509 | ) |
| 510 | data = json.loads(res) |
| 511 | self.assertEqual(data['status'], 'ok') |
| 512 | note_id = data['note_id'] |
| 513 | |
| 514 | idx = json.loads(await tool.load_index()) |
| 515 | self.assertEqual(idx['status'], 'ok') |
| 516 | self.assertEqual(idx['total_notes'], 1) |
| 517 | |
| 518 | got = json.loads(await tool.get_note( |
| 519 | note_id=note_id, parse_note=True)) |
| 520 | self.assertEqual(got['status'], 'ok') |
| 521 | self.assertEqual(got['note']['note_id'], note_id) |
| 522 | self.assertEqual(got['note']['content'], 'Claim A. Support A') |
| 523 | |
| 524 | listed = json.loads(await tool.list_notes( |
| 525 | task_id='task_1', tags=['tag1'])) |
| 526 | self.assertEqual(listed['status'], 'ok') |
| 527 | self.assertEqual(listed['count'], 1) |
| 528 | |
| 529 | listed2 = json.loads(await tool.list_notes(min_quality=90)) |
| 530 | self.assertEqual(listed2['count'], 0) |
| 531 | |
| 532 | searched = json.loads(await |
| 533 | tool.search_notes(keyword='Finding')) |
| 534 | self.assertEqual(searched['status'], 'ok') |
| 535 | self.assertEqual(searched['count'], 1) |
| 536 | |
| 537 | deleted = json.loads(await tool.delete_note(note_id=note_id)) |
| 538 | self.assertEqual(deleted['status'], 'ok') |
| 539 | |
| 540 | missing = json.loads(await tool.get_note(note_id=note_id)) |
| 541 | self.assertEqual(missing['status'], 'error') |
| 542 | |
| 543 | asyncio.run(main()) |
| 544 |
nothing calls this directly
no test coverage detected