feat: add thread info and status reads
This commit is contained in:
16 files changed
+496
-33
No files matched your search
@@ -15,6 +15,25 @@ def test_app_facade_with_memory():
|
||||
assert app.has_unread(t.id, bob) is False
|
||||
|
||||
|
||||
def test_app_thread_info_and_read_state():
|
||||
app = App(store=InMemoryStore())
|
||||
alice = app.get_or_create_agent("Alice")
|
||||
bob = app.get_or_create_agent("Bob")
|
||||
thread = app.create_thread(alice, bob)
|
||||
latest = app.append(thread.id, alice, "hello")
|
||||
|
||||
info = app.get_thread_info(thread.id)
|
||||
state = app.get_thread_read_state(thread.id, bob)
|
||||
|
||||
assert info is not None
|
||||
assert info.latest_message == latest
|
||||
assert info.message_count == 1
|
||||
assert state.cursor_seq == 0
|
||||
assert state.latest_seq == 1
|
||||
assert state.unread_count == 1
|
||||
assert state.unread_from_others_count == 1
|
||||
|
||||
|
||||
def test_app_delete_account():
|
||||
from agentmsgs.core.app import App
|
||||
from agentmsgs.stores.memory import InMemoryStore
|
||||
|
||||
Reference in new issue
Block a user