NINA / tests /test_lang.py
Malina
Claude Fable 5.1
v0.90: scoped single-use tokens, hardened link fetch, 45-minute cap, whole-video digest, one classification call, no OCR
1d697a7
Raw History Blame
636 Bytes
import pytest
from lang import detect_language
from utils import fmt_time
@pytest.mark.parametrize("text,lang", [
("Jak ta osoba ma na imię?", "Polish"),
("co się dzieje w tym filmie", "Polish"),
("What is this video about?", "English"),
("summarize the video", "English"),
("take care", "English"),
])
def test_detect(text, lang):
assert detect_language(text).lower().startswith(lang.lower()[:3])
@pytest.mark.parametrize("secs,out", [
(0, "0:00"), (5.4, "0:05"), (65, "1:05"), (599.6, "10:00"), (3600, "1:00:00"), (3725, "1:02:05"),
])
def test_fmt_time(secs, out):
assert fmt_time(secs) == out