just use deserialize instead of recover

This commit is contained in:
better629 2023-12-21 00:16:28 +08:00
parent 6877fa444f
commit 0543c0f76b
2 changed files with 3 additions and 3 deletions

View file

@ -67,7 +67,7 @@ def startup(
if not stg_path.exists() or not str(stg_path).endswith("team"):
raise FileNotFoundError(f"{recover_path} not exists or not endswith `team`")
company = Team.recover(stg_path=stg_path)
company = Team.deserialize(stg_path=stg_path)
idea = company.idea # use original idea
company.invest(investment)

View file

@ -89,7 +89,7 @@ async def test_team_recover_save():
company.run_project(idea)
await company.run(n_round=4)
new_company = Team.recover(stg_path)
new_company = Team.deserialize(stg_path)
new_role_c = new_company.env.get_role(role_c.profile)
# assert new_role_c._rc.memory == role_c._rc.memory
assert new_role_c._rc.env != role_c._rc.env
@ -123,7 +123,7 @@ async def test_team_recover_multi_roles_save():
logger.info("Team recovered")
new_company = Team.recover(stg_path)
new_company = Team.deserialize(stg_path)
new_company.run_project(idea)
assert new_company.env.get_role(role_b.profile)._rc.state == 1