-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_help.py
More file actions
58 lines (49 loc) · 1.56 KB
/
Copy pathtest_help.py
File metadata and controls
58 lines (49 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""
Tests for the VWS CLI help.
"""
import pytest
from click.testing import CliRunner
from pytest_regressions.file_regression import FileRegressionFixture
from vws_cli import vws_group
from vws_cli.query import vuforia_cloud_reco
_SUBCOMMANDS = [[item] for item in vws_group.commands]
_BASE_COMMAND: list[list[str]] = [[]]
_COMMANDS = _BASE_COMMAND + _SUBCOMMANDS
@pytest.mark.parametrize(
argnames="command",
argvalues=_COMMANDS,
ids=[str(object=cmd) for cmd in _COMMANDS],
)
def test_vws_command_help(
command: list[str],
file_regression: FileRegressionFixture,
) -> None:
"""Expected help text is shown for ``vws`` commands.
This help text is defined in files.
To update these files, run ``pytest`` with the ``--regen-all`` flag.
"""
runner = CliRunner()
arguments = [*command, "--help"]
result = runner.invoke(
cli=vws_group,
args=arguments,
catch_exceptions=False,
color=True,
)
assert result.exit_code == 0
file_regression.check(contents=result.output)
def test_query_help(file_regression: FileRegressionFixture) -> None:
"""Expected help text is shown for the ``vuforia-cloud-reco`` command.
This help text is defined in files.
To update these files, run ``pytest`` with the ``--regen-all`` flag.
"""
runner = CliRunner()
arguments = ["--help"]
result = runner.invoke(
cli=vuforia_cloud_reco,
args=arguments,
catch_exceptions=False,
color=True,
)
assert result.exit_code == 0
file_regression.check(contents=result.output)