mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
test(transcription): annotate the new passthrough test's locals as Final
This commit is contained in:
parent
54dcd9230f
commit
eb0f251b47
1 changed files with 3 additions and 2 deletions
|
|
@ -5,6 +5,7 @@ import struct
|
||||||
import wave
|
import wave
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from typing import Final
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
@ -455,10 +456,10 @@ class TestMediaFileSeconds:
|
||||||
assert media_file_seconds(media) == pytest.approx(1.5)
|
assert media_file_seconds(media) == pytest.approx(1.5)
|
||||||
|
|
||||||
def test_flac_that_does_not_state_its_length_yields_no_duration(self, tmp_path: Path):
|
def test_flac_that_does_not_state_its_length_yields_no_duration(self, tmp_path: Path):
|
||||||
streaminfo = (
|
streaminfo: Final = (
|
||||||
struct.pack(">HH", 4096, 4096) + bytes(6) + ((16000 << 44) | (15 << 36)).to_bytes(8, "big") + bytes(16)
|
struct.pack(">HH", 4096, 4096) + bytes(6) + ((16000 << 44) | (15 << 36)).to_bytes(8, "big") + bytes(16)
|
||||||
)
|
)
|
||||||
media = tmp_path / "a.flac"
|
media: Final = tmp_path / "a.flac"
|
||||||
_ = media.write_bytes(b"fLaC" + b"\x80" + len(streaminfo).to_bytes(3, "big") + streaminfo)
|
_ = media.write_bytes(b"fLaC" + b"\x80" + len(streaminfo).to_bytes(3, "big") + streaminfo)
|
||||||
|
|
||||||
assert media_file_seconds(media) is None
|
assert media_file_seconds(media) is None
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue