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