From 8da6441c87532d20d3c8dad538e46dc99d073927 Mon Sep 17 00:00:00 2001 From: Dmitrii Agibov Date: Tue, 13 Dec 2022 09:39:21 +0000 Subject: 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 --- tests/test_cli_main.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'tests/test_cli_main.py') 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( -- cgit v1.2.1