viq / tests /test_cli.py
psikosen's picture
Publish VIQ 0.6 source
fd8a21a verified
Raw History Blame Contribute Delete
1.72 kB
from viq.cli import build_parser
def test_top_level_help_formats_percent_pattern() -> None:
help_text = build_parser().format_help()
assert "%06d.png" in help_text
assert "extract" in help_text
assert "render" in help_text
assert "install-matanyone2" in help_text
def test_safe_default_only_renders_preview() -> None:
args = build_parser().parse_args(["render", "clip.mp4", "--masks", "m", "--output", "o"])
assert args.formats == ("preview",)
def test_projection_defaults_to_metadata_driven_auto() -> None:
args = build_parser().parse_args(["extract", "clip.mp4", "--output", "o"])
assert args.projection == "auto"
assert args.cube_face_size is None
assert args.matting == "auto"
assert args.matting_max_size == -1
assert args.subject_output == "combined"
def test_subject_output_modes() -> None:
parser = build_parser()
for mode in ("combined", "split", "both"):
args = parser.parse_args(["extract", "clip.mp4", "--output", "o", "--subject-output", mode])
assert args.subject_output == mode
def test_people_output_is_a_subject_output_alias() -> None:
args = build_parser().parse_args(
["extract", "clip.mp4", "--output", "o", "--people-output", "split"]
)
assert args.subject_output == "split"
def test_equirectangular_projection_arguments() -> None:
args = build_parser().parse_args(
[
"extract",
"panorama.mp4",
"--output",
"o",
"--projection",
"equirectangular",
"--cube-face-size",
"1024",
]
)
assert args.projection == "equirectangular"
assert args.cube_face_size == 1024