Skip to content

The agent that grows with you

test(qqbot): update voice detection tests for content_type-only logic

Zioywishing3122dc17445a
diff --git a/tests/gateway/test_qqbot.py b/tests/gateway/test_qqbot.py
index 562db57193d..b0e9e9c5333 100644
--- a/tests/gateway/test_qqbot.py
+++ b/tests/gateway/test_qqbot.py
@@ -139,14 +139,21 @@ class TestIsVoiceContentType:
def test_audio_content_type(self):
assert self._fn("audio/mp3", "file.mp3") is True
- def test_voice_extension(self):
- assert self._fn("", "file.silk") is True
+ def test_voice_extension_ignored_when_content_type_empty(self):
+ """content_type='' with audio extension → False (no extension sniffing)."""
+ assert self._fn("", "file.silk") is False
def test_non_voice(self):
assert self._fn("image/jpeg", "photo.jpg") is False
- def test_audio_extension_amr(self):
- assert self._fn("", "recording.amr") is True
+ def test_audio_extension_amr_ignored_when_content_type_empty(self):
+ """content_type='' with .amr extension → False (no extension sniffing)."""
+ assert self._fn("", "recording.amr") is False
+
+ def test_file_upload_with_audio_extension(self):
+ """File upload with audio extension must NOT be treated as voice."""
+ assert self._fn("file", "song.mp3") is False
+ assert self._fn("file", "audio-30251.instrumental..wav") is False
# ---------------------------------------------------------------------------