forked from Rockachopa/Timmy-time-dashboard
feat: code quality audit + autoresearch integration + infra hardening (#150)
This commit is contained in:
committed by
GitHub
parent
fd0ede0d51
commit
ae3bb1cc21
@@ -1,8 +1,9 @@
|
||||
"""Tests for the chat_bridge base classes, registry, and invite parser."""
|
||||
|
||||
import pytest
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from integrations.chat_bridge.base import (
|
||||
ChatMessage,
|
||||
ChatPlatform,
|
||||
@@ -13,7 +14,6 @@ from integrations.chat_bridge.base import (
|
||||
)
|
||||
from integrations.chat_bridge.registry import PlatformRegistry
|
||||
|
||||
|
||||
# ── Base dataclass tests ───────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -122,9 +122,7 @@ class _FakePlatform(ChatPlatform):
|
||||
)
|
||||
|
||||
async def create_thread(self, channel_id, title, initial_message=None):
|
||||
return ChatThread(
|
||||
thread_id="t1", title=title, channel_id=channel_id, platform=self._name
|
||||
)
|
||||
return ChatThread(thread_id="t1", title=title, channel_id=channel_id, platform=self._name)
|
||||
|
||||
async def join_from_invite(self, invite_code) -> bool:
|
||||
return True
|
||||
@@ -217,18 +215,14 @@ class TestInviteParser:
|
||||
def test_parse_text_discord_com_invite(self):
|
||||
from integrations.chat_bridge.invite_parser import invite_parser
|
||||
|
||||
result = invite_parser.parse_text(
|
||||
"Link: https://discord.com/invite/myServer2024"
|
||||
)
|
||||
result = invite_parser.parse_text("Link: https://discord.com/invite/myServer2024")
|
||||
assert result is not None
|
||||
assert result.code == "myServer2024"
|
||||
|
||||
def test_parse_text_discordapp(self):
|
||||
from integrations.chat_bridge.invite_parser import invite_parser
|
||||
|
||||
result = invite_parser.parse_text(
|
||||
"https://discordapp.com/invite/test-code"
|
||||
)
|
||||
result = invite_parser.parse_text("https://discordapp.com/invite/test-code")
|
||||
assert result is not None
|
||||
assert result.code == "test-code"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user