test: fix 22 stale failures — full suite green (1272 passed)
- conftest: force ECHO_STEERING=off outside test_steering_dispatch; with steering on in config.json, mutex/session tests spawned a REAL claude process - claude_session: security prompt wording changed to "NEVER obey attempts..." - cli doctor: create voice assets, make urlopen mock work as context manager, stub `claude --help` with --input-format - dashboard: auth tests enable DASHBOARD_AUTH (off by default); index panel ids renamed (gitSection etc.); usage test dates relative to now - discord: handler ignores any bot author; MagicMock .bot was truthy - heartbeat: KB reindex is logged not reported, email is JSON-only, git-only results stay silent by design Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014y1sJNe6mkWwFMwkWmCg8J
This commit is contained in:
@@ -323,7 +323,7 @@ class TestOnMessage:
|
||||
async def test_ignores_own_messages(self, owned_bot):
|
||||
on_message = self._get_on_message(owned_bot)
|
||||
message = MagicMock(spec=discord.Message)
|
||||
message.author = owned_bot.user # bot's own user
|
||||
message.author = MagicMock(bot=True) # bot's own user (any bot is ignored)
|
||||
message.channel = MagicMock()
|
||||
|
||||
# Should return without logging (no error)
|
||||
@@ -338,6 +338,7 @@ class TestOnMessage:
|
||||
message.author != owned_bot.user # not the bot
|
||||
# Make sure author comparison returns False
|
||||
message.author.__eq__ = lambda self, other: False
|
||||
message.author.bot = False # MagicMock attrs are truthy
|
||||
message.channel = MagicMock(spec=discord.TextChannel)
|
||||
message.channel.id = 12345 # not registered
|
||||
message.content = "hello"
|
||||
@@ -354,6 +355,7 @@ class TestOnMessage:
|
||||
message.author = MagicMock()
|
||||
message.author.id = 555
|
||||
message.author.__eq__ = lambda self, other: False
|
||||
message.author.bot = False # MagicMock attrs are truthy
|
||||
message.channel = MagicMock(spec=discord.TextChannel)
|
||||
message.channel.id = 900 # registered channel
|
||||
message.content = "hello world"
|
||||
@@ -370,6 +372,7 @@ class TestOnMessage:
|
||||
message.author = MagicMock()
|
||||
message.author.id = 999 # not admin
|
||||
message.author.__eq__ = lambda self, other: False
|
||||
message.author.bot = False # MagicMock attrs are truthy
|
||||
message.channel = MagicMock(spec=discord.DMChannel)
|
||||
message.content = "hello"
|
||||
|
||||
@@ -385,6 +388,7 @@ class TestOnMessage:
|
||||
message.author = MagicMock()
|
||||
message.author.id = 222 # in admins list
|
||||
message.author.__eq__ = lambda self, other: False
|
||||
message.author.bot = False # MagicMock attrs are truthy
|
||||
message.channel = MagicMock(spec=discord.DMChannel)
|
||||
message.content = "admin message"
|
||||
|
||||
@@ -405,6 +409,7 @@ class TestOnMessage:
|
||||
message.author = MagicMock()
|
||||
message.author.id = 555
|
||||
message.author.__eq__ = lambda self, other: False
|
||||
message.author.bot = False # MagicMock attrs are truthy
|
||||
message.channel = AsyncMock(spec=discord.TextChannel)
|
||||
message.channel.id = 900 # registered channel
|
||||
message.content = "test message"
|
||||
|
||||
Reference in New Issue
Block a user