* begin * chapters class, trying to add chapter splitting and general ffmpeg metadata creation * working split video * so very close * test passing, is reproducible * lint fixed * fix docs * track no longer used in example * if, then del * multiple values * github hash
22 lines
601 B
Python
22 lines
601 B
Python
import pytest
|
|
|
|
from ytdl_sub.utils.chapters import Timestamp
|
|
|
|
|
|
class TestTimestamp:
|
|
@pytest.mark.parametrize(
|
|
"timestamp_str, timestamp_int",
|
|
[
|
|
("0:00", 0),
|
|
("0:24", 24),
|
|
("1:11", 71),
|
|
("01:11", 71),
|
|
("00:22", 22),
|
|
("1:01:01", 3600 + 60 + 1),
|
|
("01:01:01", 3600 + 60 + 1),
|
|
("00:00:00", 0),
|
|
],
|
|
)
|
|
def test_timestamp_from_str(self, timestamp_str, timestamp_int):
|
|
ts = Timestamp.from_str(timestamp_str=timestamp_str)
|
|
assert ts.timestamp_sec == timestamp_int
|