feat(bot): /tag и /типы — счётчики типов и топ по типу, доступны в read-only режиме; тест (20 passed)
This commit is contained in:
@@ -170,3 +170,15 @@ def test_abuse_boost():
|
||||
a.title, b.title = "leak dump credentials 40M accounts", "weekly product update notes for teams"
|
||||
a.text = b.text = "x" * 600
|
||||
assert rank.score(a).score > rank.score(b).score
|
||||
|
||||
|
||||
|
||||
# ---------- 11. бот: /tag читается без владельца ----------
|
||||
def test_tag_command_readonly(monkeypatch):
|
||||
from omni import bot
|
||||
sent = []
|
||||
monkeypatch.setattr(bot, "OWNERS", set())
|
||||
monkeypatch.setattr(bot, "_send", lambda cid, text, **kw: sent.append(text))
|
||||
bot.handle({"message": {"chat": {"id": 1}, "from": {"id": 1}, "text": "/tag"}})
|
||||
assert sent and "типы записей" in sent[0], sent[:1]
|
||||
assert "/tag" in bot.CMDS
|
||||
|
||||
Reference in New Issue
Block a user