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

Function test_cli_list_scenes

tests/test_cli.py:411–436  ·  view source on GitHub ↗

Test `list-scenes` command.

(tmp_path: Path)

Source from the content-addressed store, hash-verified

409
410
411def test_cli_list_scenes(tmp_path: Path):
412 """Test `list-scenes` command."""
413 exit_code, _ = invoke_cli(
414 [
415 "-i",
416 DEFAULT_VIDEO_PATH,
417 "-o",
418 str(tmp_path),
419 "time",
420 "-s",
421 "2s",
422 "-d",
423 "4s",
424 "detect-content",
425 "list-scenes",
426 ]
427 )
428 assert exit_code == 0
429 output_path = tmp_path.joinpath(f"{DEFAULT_VIDEO_NAME}-Scenes.csv")
430 assert os.path.exists(output_path)
431 EXPECTED_CSV_OUTPUT = """Timecode List:,00:00:03.754
432Scene Number,Start Frame,Start Timecode,Start Time (seconds),End Frame,End Timecode,End Time (seconds),Length (frames),Length (timecode),Length (seconds)
4331,49,00:00:02.002,2.002,90,00:00:03.754,3.754,42,00:00:01.752,1.752
4342,91,00:00:03.754,3.754,144,00:00:06.006,6.006,54,00:00:02.252,2.252
435"""
436 assert output_path.read_text() == EXPECTED_CSV_OUTPUT
437
438
439def test_cli_list_scenes_skip_cuts(tmp_path: Path):

Callers

nothing calls this directly

Calls 1

invoke_cliFunction · 0.90

Tested by

no test coverage detected