From 684fd14db079c67f1a3884d7d8801fe2b3b55c1d Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sat, 9 May 2026 09:04:36 -0700 Subject: [PATCH] fix(dingtalk): align override signatures with base + guard Optional[error] in tests --- gateway/platforms/dingtalk.py | 2 ++ tests/gateway/test_dingtalk.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gateway/platforms/dingtalk.py b/gateway/platforms/dingtalk.py index 08ab1962f87..5c2285f24bb 100644 --- a/gateway/platforms/dingtalk.py +++ b/gateway/platforms/dingtalk.py @@ -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.""" diff --git a/tests/gateway/test_dingtalk.py b/tests/gateway/test_dingtalk.py index 4f54de4e4a0..aceb079b4b8 100644 --- a/tests/gateway/test_dingtalk.py +++ b/tests/gateway/test_dingtalk.py @@ -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 # ---------------------------------------------------------------------------