Validate processed frames without start time being set. End time is the end frame to stop at, but with duration, we stop at start + duration - 1.
()
| 148 | |
| 149 | |
| 150 | def test_cli_time_end(): |
| 151 | """Validate processed frames without start time being set. End time is the end frame to stop at, |
| 152 | but with duration, we stop at start + duration - 1.""" |
| 153 | EXPECTED = """[PySceneDetect] Scene List: |
| 154 | ----------------------------------------------------------------------- |
| 155 | | Scene # | Start Frame | Start Time | End Frame | End Time | |
| 156 | ----------------------------------------------------------------------- |
| 157 | | 1 | 1 | 00:00:00.000 | 10 | 00:00:00.417 | |
| 158 | ----------------------------------------------------------------------- |
| 159 | """ |
| 160 | TEST_CASES = [ |
| 161 | "time --end 10", |
| 162 | "time --end 00:00:00.417", |
| 163 | "time --end 0.417", |
| 164 | "time --duration 10", |
| 165 | "time --duration 00:00:00.417", |
| 166 | "time --duration 0.417", |
| 167 | ] |
| 168 | for test_case in TEST_CASES: |
| 169 | output = subprocess.check_output( |
| 170 | [ |
| 171 | *SCENEDETECT_CMD.split(" "), |
| 172 | "-i", |
| 173 | DEFAULT_VIDEO_PATH, |
| 174 | "-m", |
| 175 | "0", |
| 176 | "detect-content", |
| 177 | "list-scenes", |
| 178 | "-n", |
| 179 | *test_case.split(), |
| 180 | ], |
| 181 | text=True, |
| 182 | ) |
| 183 | assert EXPECTED in output, test_case |
| 184 | |
| 185 | |
| 186 | def test_cli_time_start(): |
nothing calls this directly
no outgoing calls
no test coverage detected