aboutsummaryrefslogtreecommitdiff
path: root/tests/test_cli_main.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_cli_main.py')
-rw-r--r--tests/test_cli_main.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_cli_main.py b/tests/test_cli_main.py
index 5f6beb6..925f1e4 100644
--- a/tests/test_cli_main.py
+++ b/tests/test_cli_main.py
@@ -15,10 +15,12 @@ from unittest.mock import MagicMock
import pytest
import mlia
+from mlia.backend.errors import BackendUnavailableError
from mlia.cli.main import backend_main
from mlia.cli.main import CommandInfo
from mlia.cli.main import main
from mlia.core.context import ExecutionContext
+from mlia.core.errors import InternalError
from tests.utils.logging import clear_loggers
@@ -358,6 +360,33 @@ def test_commands_execution_backend_main(
MagicMock(side_effect=KeyboardInterrupt()),
["Execution has been interrupted"],
],
+ [
+ False,
+ MagicMock(
+ side_effect=BackendUnavailableError(
+ "Backend sample is not available", "sample"
+ )
+ ),
+ ["Error: Backend sample is not available."],
+ ],
+ [
+ False,
+ MagicMock(
+ side_effect=BackendUnavailableError(
+ "Backend tosa-checker is not available", "tosa-checker"
+ )
+ ),
+ [
+ "Error: Backend tosa-checker is not available.",
+ "Please use next command to install it: "
+ 'mlia-backend install "tosa-checker"',
+ ],
+ ],
+ [
+ False,
+ MagicMock(side_effect=InternalError("Unknown error")),
+ ["Internal error: Unknown error"],
+ ],
],
)
def test_verbose_output(