mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-17 15:35:21 +02:00
refactor: tx_from/tx_to
This commit is contained in:
parent
ed7eb4d08a
commit
c6f97f7487
10 changed files with 32 additions and 32 deletions
|
|
@ -69,7 +69,7 @@ async def test_react():
|
|||
env = Environment()
|
||||
env.add_role(role)
|
||||
assert env.get_subscribed_tags(role) == {seed.subscription}
|
||||
env.publish_message(Message(content="test", tx_to=seed.subscription))
|
||||
env.publish_message(Message(content="test", msg_to=seed.subscription))
|
||||
assert not role.is_idle
|
||||
while not env.is_idle:
|
||||
await env.run()
|
||||
|
|
|
|||
|
|
@ -66,13 +66,13 @@ def test_message():
|
|||
def test_routes():
|
||||
route = Routes()
|
||||
route.set_from("a")
|
||||
assert route.tx_from == "a"
|
||||
assert route.msg_from == "a"
|
||||
route.add_to("b")
|
||||
assert route.tx_to == {"b"}
|
||||
assert route.msg_to == {"b"}
|
||||
route.add_to("c")
|
||||
assert route.tx_to == {"b", "c"}
|
||||
assert route.msg_to == {"b", "c"}
|
||||
route.set_to({"e", "f"})
|
||||
assert route.tx_to == {"e", "f"}
|
||||
assert route.msg_to == {"e", "f"}
|
||||
assert route.is_recipient({"e"})
|
||||
assert route.is_recipient({"f"})
|
||||
assert not route.is_recipient({"a"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue