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

Function test_cli_time_start

tests/test_cli.py:186–219  ·  view source on GitHub ↗

Validate processed frames with both start and end/duration set. End time is the end frame to stop at, but with duration, we stop at start + duration - 1.

()

Source from the content-addressed store, hash-verified

184
185
186def test_cli_time_start():
187 """Validate processed frames with both start and end/duration set. End time is the end frame to
188 stop at, but with duration, we stop at start + duration - 1."""
189 EXPECTED = """[PySceneDetect] Scene List:
190-----------------------------------------------------------------------
191 | Scene # | Start Frame | Start Time | End Frame | End Time |
192-----------------------------------------------------------------------
193 | 1 | 4 | 00:00:00.125 | 10 | 00:00:00.417 |
194-----------------------------------------------------------------------
195"""
196 TEST_CASES = [
197 "time --start 4 --end 10",
198 "time --start 4 --end 00:00:00.417",
199 "time --start 4 --end 0.417",
200 "time --start 4 --duration 7",
201 "time --start 4 --duration 0.292",
202 "time --start 4 --duration 00:00:00.292",
203 ]
204 for test_case in TEST_CASES:
205 output = subprocess.check_output(
206 [
207 *SCENEDETECT_CMD.split(" "),
208 "-i",
209 DEFAULT_VIDEO_PATH,
210 "-m",
211 "0",
212 "detect-content",
213 "list-scenes",
214 "-n",
215 *test_case.split(),
216 ],
217 text=True,
218 )
219 assert EXPECTED in output, test_case
220
221
222def test_cli_time_scene_boundary():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected