mirror of
https://github.com/snowy-yang/xiaonuan.git
synced 2026-10-21 08:04:48 +00:00
修正 test_memory_from_days_ago 的窗口算术
This commit is contained in:
1 parent
e9e5afa0da
commit
77943302f4
1 file changed
+2
-1
+2
-1
@@ -141,5 +141,6 @@ async def test_memory_from_days_ago(conn):
|
|||||||
await db.add_message(s, "user", "半个月前的话")
|
await db.add_message(s, "user", "半个月前的话")
|
||||||
rows = await db.memory_from_days_ago(s, 15, time.time())
|
rows = await db.memory_from_days_ago(s, 15, time.time())
|
||||||
assert rows == [] # 刚插入的不在 15 天前
|
assert rows == [] # 刚插入的不在 15 天前
|
||||||
rows = await db.memory_from_days_ago(s, 0, time.time() + 86400)
|
# days=0 的窗口是 [now_ts, now_ts+86400],now_ts 用现在即可罩住刚插入的
|
||||||
|
rows = await db.memory_from_days_ago(s, 0, time.time())
|
||||||
assert any(r["content"] == "半个月前的话" for r in rows)
|
assert any(r["content"] == "半个月前的话" for r in rows)
|
||||||
Reference in new issue
Block a user