mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-29 18:46:59 +00:00
test(qqbot): update voice detection tests for content_type-only logic
Update TestIsVoiceContentType to match the new behavior: - Empty content_type with audio extensions → False (no sniffing) - File upload with audio extension → False - Added test_file_upload_with_audio_extension for the reported bug case
This commit is contained in:
parent
b74c033ca1
commit
3122dc1744
1 changed files with 11 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue