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

Function test_cli_save_otio

tests/test_cli.py:982–1196  ·  view source on GitHub ↗

Test `save-otio` command.

(tmp_path: Path)

Source from the content-addressed store, hash-verified

980
981
982def test_cli_save_otio(tmp_path: Path):
983 """Test `save-otio` command."""
984 exit_code, _ = invoke_cli(
985 [
986 "-i",
987 DEFAULT_VIDEO_PATH,
988 "-o",
989 str(tmp_path),
990 "time",
991 "-s",
992 "2s",
993 "-d",
994 "4s",
995 "detect-content",
996 "save-otio",
997 ]
998 )
999 assert exit_code == 0
1000 output_path = tmp_path.joinpath(f"{DEFAULT_VIDEO_NAME}.otio")
1001 assert os.path.exists(output_path)
1002 EXPECTED_OTIO_OUTPUT = """{
1003 "OTIO_SCHEMA": "Timeline.1",
1004 "name": "goldeneye (PySceneDetect)",
1005 "global_start_time": {
1006 "OTIO_SCHEMA": "RationalTime.1",
1007 "rate": 23.976023976023978,
1008 "value": 0.0
1009 },
1010 "tracks": {
1011 "OTIO_SCHEMA": "Stack.1",
1012 "enabled": true,
1013 "children": [
1014 {
1015 "OTIO_SCHEMA": "Track.1",
1016 "name": "Video 1",
1017 "enabled": true,
1018 "children": [
1019 {
1020 "OTIO_SCHEMA": "Clip.2",
1021 "name": "goldeneye.mp4",
1022 "source_range": {
1023 "OTIO_SCHEMA": "TimeRange.1",
1024 "duration": {
1025 "OTIO_SCHEMA": "RationalTime.1",
1026 "rate": 23.976023976023978,
1027 "value": 42.0
1028 },
1029 "start_time": {
1030 "OTIO_SCHEMA": "RationalTime.1",
1031 "rate": 23.976023976023978,
1032 "value": 48.0
1033 }
1034 },
1035 "enabled": true,
1036 "media_references": {
1037 "DEFAULT_MEDIA": {
1038 "OTIO_SCHEMA": "ExternalReference.1",
1039 "name": "goldeneye.mp4",

Callers

nothing calls this directly

Calls 1

invoke_cliFunction · 0.90

Tested by

no test coverage detected