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

Function test_comparisons_with_bare_timecode

tests/test_timecode.py:466–479  ·  view source on GitHub ↗

`FrameTimecode` comparison operators should accept a bare :class:`Timecode` operand.

()

Source from the content-addressed store, hash-verified

464
465
466def test_comparisons_with_bare_timecode():
467 """`FrameTimecode` comparison operators should accept a bare :class:`Timecode` operand."""
468 fps = 30.0
469 half_second_frame = FrameTimecode(timecode=15, fps=fps)
470 half_second_tc = Timecode(pts=500, time_base=Fraction(1, 1000))
471 one_second_tc = Timecode(pts=1000, time_base=Fraction(1, 1000))
472
473 assert half_second_frame == half_second_tc
474 assert half_second_frame != one_second_tc
475 assert half_second_frame < one_second_tc
476 assert half_second_frame <= half_second_tc
477 assert one_second_tc != half_second_frame # reflected via __ne__
478 assert FrameTimecode(timecode=30, fps=fps) > half_second_tc
479 assert FrameTimecode(timecode=15, fps=fps) >= half_second_tc
480
481
482def test_min_scene_len_accepts_timecode_like():

Callers

nothing calls this directly

Calls 2

FrameTimecodeClass · 0.90
TimecodeClass · 0.90

Tested by

no test coverage detected