|
12 | 12 |
|
13 | 13 | import os |
14 | 14 | import subprocess |
15 | | -import typing as ty |
16 | | -from pathlib import Path |
17 | | - |
18 | | -import cv2 |
19 | | -import numpy as np |
20 | | -import pytest |
21 | | - |
22 | | -import scenedetect |
23 | | -from scenedetect.output import is_ffmpeg_available, is_mkvmerge_available |
24 | 15 |
|
25 | 16 | # These tests validate that the CLI itself functions correctly, mainly based on the return |
26 | 17 | # return code from the process. We do not yet check for correctness of the output, just a |
27 | 18 | # successful invocation of the command (i.e. no exceptions/errors). |
28 | | - |
29 | 19 | # TODO: Add some basic correctness tests to validate the output (just look for the |
30 | 20 | # last expected log message or extract # of scenes). Might need to refactor the test cases |
31 | 21 | # since we need to calculate the output file names for commands that write to disk. |
32 | | - |
33 | 22 | # TODO: Define error/exit codes explicitly. Right now these tests only verify that the |
34 | 23 | # exit code is zero or nonzero. |
35 | | - |
36 | 24 | # TODO: These tests are very expensive since they spin up new Python interpreters. |
37 | 25 | # Move most of these test cases (e.g. argument validation) to ones that interface directly |
38 | 26 | # with the scenedetect._cli module. Click also supports unit testing directly, so we should |
39 | 27 | # probably use that instead of spinning up new subprocesses for each run of the controller. |
40 | 28 | # That will also allow splitting up the validation of argument parsing logic from the controller |
41 | 29 | # logic by creating a CLI context with the desired parameters. |
42 | | - |
43 | 30 | # TODO: Missing tests for --min-scene-len and --drop-short-scenes. |
| 31 | +import sys |
| 32 | +import typing as ty |
| 33 | +from pathlib import Path |
| 34 | + |
| 35 | +import cv2 |
| 36 | +import numpy as np |
| 37 | +import pytest |
| 38 | + |
| 39 | +import scenedetect |
| 40 | +from scenedetect.output import is_ffmpeg_available, is_mkvmerge_available |
| 41 | + |
| 42 | +SCENEDETECT_CMD = sys.executable + " -m scenedetect" |
44 | 43 |
|
45 | | -SCENEDETECT_CMD = "python -m scenedetect" |
46 | 44 | ALL_DETECTORS = [ |
47 | 45 | "detect-content", |
48 | 46 | "detect-threshold", |
|
0 commit comments