style: ruff format + stronger sqlite asserts (delete utils, drop test_no_gng)
This commit is contained in:
+12
-7
@@ -1,11 +1,13 @@
|
||||
from agentmsgs.stores.memory import InMemoryStore
|
||||
from agentmsgs.core import ops
|
||||
from agentmsgs.stores.memory import InMemoryStore
|
||||
|
||||
|
||||
def test_ops_validates_sender_must_be_in_thread():
|
||||
s = InMemoryStore()
|
||||
a = ops.get_or_create_agent(s, "A"); b = ops.get_or_create_agent(s, "B"); c = ops.get_or_create_agent(s, "C")
|
||||
t = ops.create_thread(s, {a,b})
|
||||
a = ops.get_or_create_agent(s, "A")
|
||||
b = ops.get_or_create_agent(s, "B")
|
||||
c = ops.get_or_create_agent(s, "C")
|
||||
t = ops.create_thread(s, {a, b})
|
||||
try:
|
||||
ops.append_message(s, t.id, c, "oops")
|
||||
assert False, "should raise"
|
||||
@@ -15,8 +17,9 @@ def test_ops_validates_sender_must_be_in_thread():
|
||||
|
||||
def test_ops_has_unread_exclude_own():
|
||||
s = InMemoryStore()
|
||||
a = ops.get_or_create_agent(s, "A"); b = ops.get_or_create_agent(s, "B")
|
||||
t = ops.create_thread(s, {a,b})
|
||||
a = ops.get_or_create_agent(s, "A")
|
||||
b = ops.get_or_create_agent(s, "B")
|
||||
t = ops.create_thread(s, {a, b})
|
||||
ops.append_message(s, t.id, a, "a1")
|
||||
# b has unread, a's own message shouldn't count if exclude_own
|
||||
assert ops.has_unread(s, t.id, b) is True
|
||||
@@ -28,8 +31,10 @@ def test_ops_has_unread_exclude_own():
|
||||
|
||||
def test_ops_join_and_delete():
|
||||
s = InMemoryStore()
|
||||
a = ops.get_or_create_agent(s, "A"); b = ops.get_or_create_agent(s, "B"); c = ops.get_or_create_agent(s, "C")
|
||||
t = ops.create_thread(s, {a,b})
|
||||
a = ops.get_or_create_agent(s, "A")
|
||||
b = ops.get_or_create_agent(s, "B")
|
||||
c = ops.get_or_create_agent(s, "C")
|
||||
t = ops.create_thread(s, {a, b})
|
||||
t2 = ops.join_thread(s, t.id, c)
|
||||
assert c in t2.participants
|
||||
ops.delete_agent(s, c.id)
|
||||
|
||||
Reference in New Issue
Block a user