Debian Codegraph @

tests/units/cli/exec/test__init__.py

raw symbols SCIP
1 # Copyright (c) 2023-2026 Arista Networks, Inc.
2 # Use of this source code is governed by the Apache License 2.0
3 # that can be found in the LICENSE file.
4 """Tests for anta.cli.exec."""
5
6 from __future__ import annotations
7
8 from typing import TYPE_CHECKING
9
10 from anta.cli import anta
11 from anta.cli.utils import ExitCode
12
13 if TYPE_CHECKING:
14 from click.testing import CliRunner
15
16
17 def test_anta_exec(click_runner: CliRunner) -> None:
18 """Test anta exec."""
19 result = click_runner.invoke(anta, ["exec"])
20 assert result.exit_code == ExitCode.USAGE_ERROR
21 assert "Usage: anta exec" in result.output
22
23
24 def test_anta_exec_help(click_runner: CliRunner) -> None:
25 """Test anta exec --help."""
26 result = click_runner.invoke(anta, ["exec", "--help"])
27 assert result.exit_code == ExitCode.OK
28 assert "Usage: anta exec" in result.output