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

Function test_cli_load_scenes_output

tests/test_cli.py:822–861  ·  view source on GitHub ↗

Verify we can use `load-scenes` with the `time` command and get the desired output.

()

Source from the content-addressed store, hash-verified

820
821
822def test_cli_load_scenes_output():
823 """Verify we can use `load-scenes` with the `time` command and get the desired output."""
824 scenes_csv = """
825Scene Number,Start Frame
8261,49
8272,91
8283,211
829"""
830 with open("test_scene_list.csv", "w") as f:
831 f.write(scenes_csv)
832 output = subprocess.check_output(
833 [
834 *SCENEDETECT_CMD.split(" "),
835 "-i",
836 DEFAULT_VIDEO_PATH,
837 "load-scenes",
838 "-i",
839 "test_scene_list.csv",
840 "time",
841 "-s",
842 "2s",
843 "-e",
844 "10s",
845 "list-scenes",
846 ],
847 text=True,
848 )
849 assert (
850 """
851-----------------------------------------------------------------------
852 | Scene # | Start Frame | Start Time | End Frame | End Time |
853-----------------------------------------------------------------------
854 | 1 | 49 | 00:00:02.002 | 90 | 00:00:03.754 |
855 | 2 | 91 | 00:00:03.754 | 210 | 00:00:08.759 |
856 | 3 | 211 | 00:00:08.759 | 240 | 00:00:10.010 |
857-----------------------------------------------------------------------
858"""
859 in output
860 )
861 assert "00:00:03.754,00:00:08.759" in output
862
863
864def test_cli_load_scenes_round_trip():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected