fix(dingtalk): align override signatures with base + guard Optional[error] in tests
This commit is contained in:
@@ -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."""
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user