mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-17 15:35:21 +02:00
fix #687
This commit is contained in:
parent
4c55a976c6
commit
61bb7749e4
4 changed files with 22 additions and 6 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import tempfile
|
||||
from pathlib import Path
|
||||
from random import random
|
||||
from tempfile import TemporaryDirectory
|
||||
|
|
@ -6,6 +7,7 @@ import pytest
|
|||
|
||||
from metagpt.actions.research import CollectLinks
|
||||
from metagpt.roles import researcher
|
||||
from metagpt.team import Team
|
||||
from metagpt.tools import SearchEngineType
|
||||
from metagpt.tools.search_engine import SearchEngine
|
||||
|
||||
|
|
@ -57,5 +59,13 @@ def test_write_report(mocker, context):
|
|||
assert (researcher.RESEARCH_PATH / f"{i+1}. metagpt.md").read_text().startswith("# Research Report")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_serialize():
|
||||
team = Team()
|
||||
team.hire([researcher.Researcher()])
|
||||
with tempfile.TemporaryDirectory() as dirname:
|
||||
team.serialize(Path(dirname) / "team.json")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
pytest.main([__file__, "-s"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue