mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-05 05:42:37 +02:00
refactor: Override cause_by
This commit is contained in:
parent
c4eb028a83
commit
1febf168e7
2 changed files with 43 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ import json
|
|||
|
||||
import pytest
|
||||
|
||||
from metagpt.actions import Action
|
||||
from metagpt.schema import AIMessage, Message, Routes, SystemMessage, UserMessage
|
||||
|
||||
|
||||
|
|
@ -50,6 +51,15 @@ def test_message():
|
|||
assert m.cause_by == "c"
|
||||
assert m.get_meta("x") == "d"
|
||||
|
||||
m.cause_by = "Message"
|
||||
assert m.cause_by == "Message"
|
||||
m.cause_by = Action
|
||||
assert m.cause_by == Action.get_class_name()
|
||||
m.cause_by = Action()
|
||||
assert m.cause_by == Action.get_class_name()
|
||||
m.content = "b"
|
||||
assert m.content == "b"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
def test_routes():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue