MCPcopy Create free account
hub / github.com/modelscope/ms-agent / main

Method main

tests/tools/test_server_tools_smoke.py:621–715  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

619 def test_report_tool_outline_chapter_draft_conflict(self):
620
621 async def main():
622 with tempfile.TemporaryDirectory() as td:
623 # Prepare evidence using EvidenceTool to ensure realistic on-disk structure.
624 ev_cfg = _make_config(
625 td, tools={'evidence_store': SimpleNamespace()})
626 ev = EvidenceTool(ev_cfg)
627 await ev.connect()
628 n1 = json.loads(await ev.write_note(
629 title='N1',
630 content='C1. S1',
631 sources=[{
632 'url': 'https://example.com/1'
633 }],
634 summary='sum1',
635 task_id='task_1',
636 tags=['t'],
637 ))
638 n2 = json.loads(await ev.write_note(
639 title='N2',
640 content='C2. S2',
641 sources=[{
642 'url': 'https://example.com/2'
643 }],
644 summary='sum2',
645 task_id='task_1',
646 tags=['t'],
647 ))
648 note_ids = [n1['note_id'], n2['note_id']]
649
650 cfg = _make_config(
651 td, tools={'report_generator': SimpleNamespace()})
652 tool = ReportTool(cfg)
653 await tool.connect()
654
655 outline_res = json.loads(await tool.commit_outline(
656 title='My Report',
657 chapters=[{
658 'title': 'Ch1',
659 'goals': ['g1'],
660 'sections_description': 'sec',
661 'candidate_evidence': note_ids,
662 }],
663 ))
664 self.assertEqual(outline_res['status'], 'ok')
665
666 bundle = json.loads(await tool.prepare_chapter_bundle(
667 chapter_id=1,
668 relevant_evidence=[note_ids[1]],
669 need_raw_chunks=False,
670 ))
671 self.assertEqual(bundle['status'], 'ok')
672 self.assertEqual(bundle['chapter_id'], 1)
673 self.assertEqual(bundle['evidence_count'], 2)
674 self.assertTrue(
675 os.path.exists(os.path.join(td, bundle['meta_path'])))
676
677 chapter_res = json.loads(await tool.commit_chapter(
678 chapter_id=1,

Callers 1

Calls 14

connectMethod · 0.95
write_noteMethod · 0.95
connectMethod · 0.95
commit_outlineMethod · 0.95
commit_chapterMethod · 0.95
assemble_draftMethod · 0.95
commit_conflictMethod · 0.95
get_statusMethod · 0.95
update_outlineMethod · 0.95
load_chunkMethod · 0.95
EvidenceToolClass · 0.90

Tested by

no test coverage detected