From 45af1118b566f1d091acc74d9ca8d6b6bf656bbf Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sun, 26 Jul 2026 12:35:26 -0700 Subject: [PATCH] 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=[...]. --- tests/gateway/test_send_image_file.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/gateway/test_send_image_file.py b/tests/gateway/test_send_image_file.py index 54a3faadb4c..7a675407840 100644 --- a/tests/gateway/test_send_image_file.py +++ b/tests/gateway/test_send_image_file.py @@ -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):