feat: thin App facade over ops/store
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from agentmsgs.core.app import App
|
||||
from agentmsgs.stores.memory import InMemoryStore
|
||||
|
||||
|
||||
def test_app_facade_with_memory():
|
||||
app = App(store=InMemoryStore())
|
||||
alice = app.get_or_create_agent("Alice")
|
||||
bob = app.get_or_create_agent("Bob")
|
||||
t = app.create_thread(alice, bob)
|
||||
app.append(t.id, alice, "hello")
|
||||
assert app.has_unread(t.id, bob) is True
|
||||
msgs = app.poll(t.id, bob)
|
||||
assert len(msgs) == 1
|
||||
app.mark_read(t.id, bob, msgs[0].seq)
|
||||
assert app.has_unread(t.id, bob) is False
|
||||
|
||||
|
||||
def test_app_delete_account():
|
||||
from agentmsgs.core.app import App
|
||||
from agentmsgs.stores.memory import InMemoryStore
|
||||
|
||||
app = App(store=InMemoryStore())
|
||||
a = app.get_or_create_agent("A")
|
||||
app.delete_account(a.id)
|
||||
assert app.store.get_agent_by_id(a.id) is None
|
||||
Reference in New Issue
Block a user