test(discord): update send_document/send_video expectations to plural files= kwarg

Sibling tests pinned the old singular file= handle form that #66797
replaced with path-based File via files=[...].
This commit is contained in:
teknium1 2026-07-26 12:35:26 -07:00 committed by Teknium
parent c82f4636f2
commit 45af1118b5

View file

@ -242,7 +242,11 @@ class TestDiscordSendImageFile:
assert result.success
assert result.message_id == "100"
assert "file" in mock_channel.send.call_args.kwargs
# #66797: path-based File sent via plural files=[...] (matches the
# image-batch path; the singular file= handle form could race the
# multipart encoder and silently drop the attachment).
sent_files = mock_channel.send.call_args.kwargs.get("files")
assert sent_files and len(sent_files) == 1
assert file_cls.call_args.kwargs["filename"] == "renamed.pdf"
def test_send_video_uploads_file_attachment(self, adapter, tmp_path):
@ -267,7 +271,9 @@ class TestDiscordSendImageFile:
assert result.success
assert result.message_id == "101"
assert "file" in mock_channel.send.call_args.kwargs
# #66797: path-based File sent via plural files=[...] (see above).
sent_files = mock_channel.send.call_args.kwargs.get("files")
assert sent_files and len(sent_files) == 1
assert file_cls.call_args.kwargs["filename"] == "clip.mp4"
def test_returns_error_when_file_missing(self, adapter):