fix(dingtalk): align override signatures with base + guard Optional[error] in tests

This commit is contained in:
Teknium 2026-05-09 09:04:36 -07:00
parent c705c7ac9b
commit 684fd14db0
2 changed files with 4 additions and 2 deletions

View file

@ -916,6 +916,7 @@ class DingTalkAdapter(BasePlatformAdapter):
image_path: str,
caption: Optional[str] = None,
reply_to: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
**kwargs,
) -> SendResult:
"""DingTalk webhook replies cannot send local image files directly."""
@ -934,6 +935,7 @@ class DingTalkAdapter(BasePlatformAdapter):
caption: Optional[str] = None,
file_name: Optional[str] = None,
reply_to: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
**kwargs,
) -> SendResult:
"""DingTalk webhook replies cannot send local file attachments directly."""

View file

@ -256,7 +256,7 @@ class TestSend:
result = await adapter.send_image_file("chat-123", "/tmp/demo.png")
assert result.success is False
assert "do not support local image uploads" in result.error
assert result.error and "do not support local image uploads" in result.error
@pytest.mark.asyncio
async def test_send_document_returns_explicit_unsupported_error(self):
@ -266,7 +266,7 @@ class TestSend:
result = await adapter.send_document("chat-123", "/tmp/demo.pdf")
assert result.success is False
assert "do not support local file attachments" in result.error
assert result.error and "do not support local file attachments" in result.error
# ---------------------------------------------------------------------------