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

Function test_framerate_legacy_alias

tests/test_video_stream.py:349–358  ·  view source on GitHub ↗

`framerate=` is the soft-deprecated alias for `frame_rate=` (issue #548). All backends must accept both forms and produce the same `frame_rate`.

(vs_type: ty.Callable[..., VideoStream])

Source from the content-addressed store, hash-verified

347
348
349def test_framerate_legacy_alias(vs_type: ty.Callable[..., VideoStream]):
350 """`framerate=` is the soft-deprecated alias for `frame_rate=` (issue #548). All backends
351 must accept both forms and produce the same `frame_rate`."""
352 path = get_absolute_path("resources/goldeneye.mp4")
353 legacy = vs_type(path, framerate=30.0)
354 canonical = vs_type(path, frame_rate=30.0)
355 assert legacy.frame_rate == canonical.frame_rate
356 # When both are provided, `frame_rate` wins (legacy is ignored).
357 both = vs_type(path, frame_rate=30.0, framerate=24.0)
358 assert both.frame_rate == canonical.frame_rate
359
360
361def test_corrupt_video(vs_type: ty.Callable[..., VideoStream], corrupt_video_file: str):

Callers

nothing calls this directly

Calls 1

get_absolute_pathFunction · 0.70

Tested by

no test coverage detected