mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-14 15:25:17 +02:00
refine tests
This commit is contained in:
parent
10cae23501
commit
f182b290cc
4 changed files with 16 additions and 14 deletions
|
|
@ -14,13 +14,13 @@ from metagpt.schema import RunCodeContext
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_run_text():
|
||||
result, errs = await RunCode.run_text("result = 1 + 1")
|
||||
assert result == 2
|
||||
assert errs == ""
|
||||
out, err = await RunCode.run_text("result = 1 + 1")
|
||||
assert out == 2
|
||||
assert err == ""
|
||||
|
||||
result, errs = await RunCode.run_text("result = 1 / 0")
|
||||
assert result == ""
|
||||
assert "ZeroDivisionError" in errs
|
||||
out, err = await RunCode.run_text("result = 1 / 0")
|
||||
assert out == ""
|
||||
assert "division by zero" in err
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
|
|||
|
|
@ -63,9 +63,9 @@ async def test_react():
|
|||
assert role._rc.watch == {any_to_str(UserRequirement)}
|
||||
assert role.name == seed.name
|
||||
assert role.profile == seed.profile
|
||||
assert role._setting.goal == seed.goal
|
||||
assert role._setting.constraints == seed.constraints
|
||||
assert role._setting.desc == seed.desc
|
||||
assert role.goal == seed.goal
|
||||
assert role.constraints == seed.constraints
|
||||
assert role.desc == seed.desc
|
||||
assert role.is_idle
|
||||
env = Environment()
|
||||
env.add_role(role)
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@ def test_team():
|
|||
company = Team()
|
||||
company.hire([ProjectManager()])
|
||||
|
||||
assert len(company.environment.roles) == 1
|
||||
assert len(company.env.roles) == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue