MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / test_subtraction

Function test_subtraction

tests/test_timecode.py:318–330  ·  view source on GitHub ↗

Test FrameTimecode subtraction (-/-=, __sub__) operator.

()

Source from the content-addressed store, hash-verified

316
317
318def test_subtraction():
319 """Test FrameTimecode subtraction (-/-=, __sub__) operator."""
320 x = FrameTimecode(timecode=1.0, fps=10.0)
321 assert (x - 1) == FrameTimecode(timecode=0.9, fps=10.0)
322 assert x - 2 == FrameTimecode(0.8, x)
323 assert x - 10 == FrameTimecode(0.0, x)
324 # TODO(v1.0): Allow negative values. For now we clamp.
325 assert x - 11 == FrameTimecode(0.0, x)
326 assert x - 100 == FrameTimecode(0.0, x)
327 assert x - 1.0 == FrameTimecode(0.0, x)
328 assert x - 100.0 == FrameTimecode(0.0, x)
329 assert x - 1 == FrameTimecode(timecode=0.9, fps=10.0)
330 assert FrameTimecode("00:00:00.000", fps=20.0) == x - 10
331
332
333@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

FrameTimecodeClass · 0.90

Tested by

no test coverage detected