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

Function test_cli_load_scenes_round_trip

tests/test_cli.py:864–913  ·  view source on GitHub ↗

Verify we can use `load-scenes` and get the same scenes as output with `list-scenes`.

()

Source from the content-addressed store, hash-verified

862
863
864def test_cli_load_scenes_round_trip():
865 """Verify we can use `load-scenes` and get the same scenes as output with `list-scenes`."""
866 scenes_csv = """
867Scene Number,Start Frame
8681,49
8692,91
8703,211
871"""
872 with open("test_scene_list.csv", "w") as f:
873 f.write(scenes_csv)
874 ground_truth = subprocess.check_output(
875 [
876 *SCENEDETECT_CMD.split(" "),
877 "-i",
878 DEFAULT_VIDEO_PATH,
879 "detect-content",
880 "list-scenes",
881 "-f",
882 "testout.csv",
883 "time",
884 "-s",
885 "200",
886 "-e",
887 "400",
888 ],
889 text=True,
890 )
891 loaded_first_pass = subprocess.check_output(
892 [
893 *SCENEDETECT_CMD.split(" "),
894 "-i",
895 DEFAULT_VIDEO_PATH,
896 "load-scenes",
897 "-i",
898 "testout.csv",
899 "time",
900 "-s",
901 "200",
902 "-e",
903 "400",
904 "list-scenes",
905 "-f",
906 "testout2.csv",
907 ],
908 text=True,
909 )
910 SPLIT_POINT = " | Scene # | Start Frame | Start Time | End Frame | End Time |"
911 assert ground_truth.split(SPLIT_POINT)[1] == loaded_first_pass.split(SPLIT_POINT)[1]
912 with open("testout.csv") as first, open("testout2.csv") as second:
913 assert first.readlines() == second.readlines()
914
915
916def test_cli_save_edl(tmp_path: Path):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected