add context and config2

This commit is contained in:
geekan 2024-01-04 23:33:09 +08:00
parent 10436172ca
commit 5c1f3a4b91
8 changed files with 34 additions and 34 deletions

View file

@ -25,6 +25,6 @@ async def test_prepare_documents():
await PrepareDocuments(g_context=context).run(with_messages=[msg])
assert context.git_repo
doc = await FileRepository.get_file(filename=REQUIREMENT_FILENAME, relative_path=DOCS_FILE_REPO)
doc = await FileRepository(context.git_repo).get_file(filename=REQUIREMENT_FILENAME, relative_path=DOCS_FILE_REPO)
assert doc
assert doc.content == msg.content

View file

@ -7,6 +7,7 @@
"""
import pytest
from metagpt.context import context
from metagpt.logs import logger
from metagpt.roles import ProductManager
from tests.metagpt.roles.mock import MockMessages
@ -15,7 +16,7 @@ from tests.metagpt.roles.mock import MockMessages
@pytest.mark.asyncio
@pytest.mark.usefixtures("llm_mock")
async def test_product_manager():
product_manager = ProductManager()
product_manager = ProductManager(context=context)
rsp = await product_manager.run(MockMessages.req)
logger.info(rsp)
assert len(rsp.content) > 0