aboutsummaryrefslogtreecommitdiff
path: root/tests/test_cli_main.py
diff options
context:
space:
mode:
authorDmitrii Agibov <dmitrii.agibov@arm.com>2022-12-13 09:39:21 +0000
committerDmitrii Agibov <dmitrii.agibov@arm.com>2022-12-16 09:25:21 +0000
commit8da6441c87532d20d3c8dad538e46dc99d073927 (patch)
tree6afb7f0c82c5c357f7497413f0e18473e84d472c /tests/test_cli_main.py
parentba9aeace4c3d3f4f31830d68b5cc7dd3f4bf1dde (diff)
downloadmlia-8da6441c87532d20d3c8dad538e46dc99d073927.tar.gz
MLIA-460 Revisit backend management
- Provide command for backend installation in case if backend is not available - Fix issue with connection timeout during downloading - Show installation tools output only in verbose mode Change-Id: Ic0e495ba19879cc2cda4fd0bce20b57ba896cfeb
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(