diff options
author | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2022-06-28 10:29:35 +0100 |
---|---|---|
committer | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2022-07-08 10:57:19 +0100 |
commit | c9b4089b3037b5943565d76242d3016b8776f8d2 (patch) | |
tree | 3de24f79dedf0f26f492a7fa1562bf684e13a055 /tests/aiet/test_backend_tool.py | |
parent | ba2c7fcccf37e8c81946f0776714c64f73191787 (diff) | |
download | mlia-c9b4089b3037b5943565d76242d3016b8776f8d2.tar.gz |
MLIA-546 Merge AIET into MLIA
Merge the deprecated AIET interface for backend execution into MLIA:
- Execute backends directly (without subprocess and the aiet CLI)
- Fix issues with the unit tests
- Remove src/aiet and tests/aiet
- Re-factor code to replace 'aiet' with 'backend'
- Adapt and improve unit tests after re-factoring
- Remove dependencies that are not needed anymore (click and cloup)
Change-Id: I450734c6a3f705ba9afde41862b29e797e511f7c
Diffstat (limited to 'tests/aiet/test_backend_tool.py')
-rw-r--r-- | tests/aiet/test_backend_tool.py | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/tests/aiet/test_backend_tool.py b/tests/aiet/test_backend_tool.py deleted file mode 100644 index fd5960d..0000000 --- a/tests/aiet/test_backend_tool.py +++ /dev/null @@ -1,60 +0,0 @@ -# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. -# SPDX-License-Identifier: Apache-2.0 -# pylint: disable=no-self-use -"""Tests for the tool backend.""" -from collections import Counter - -import pytest - -from aiet.backend.common import ConfigurationException -from aiet.backend.config import ToolConfig -from aiet.backend.tool import get_available_tool_directory_names -from aiet.backend.tool import get_available_tools -from aiet.backend.tool import get_tool -from aiet.backend.tool import Tool - - -def test_get_available_tool_directory_names() -> None: - """Test get_available_tools mocking get_resources.""" - directory_names = get_available_tool_directory_names() - assert Counter(directory_names) == Counter(["tool1", "tool2", "vela"]) - - -def test_get_available_tools() -> None: - """Test get_available_tools mocking get_resources.""" - available_tools = get_available_tools() - expected_tool_names = sorted( - [ - "tool_1", - "tool_2", - "vela", - "vela", - "vela", - ] - ) - - assert all(isinstance(s, Tool) for s in available_tools) - assert all(s != 42 for s in available_tools) - assert any(s == available_tools[0] for s in available_tools) - assert len(available_tools) == len(expected_tool_names) - available_tool_names = sorted(str(s) for s in available_tools) - assert available_tool_names == expected_tool_names - - -def test_get_tool() -> None: - """Test get_tool mocking get_resoures.""" - tools = get_tool("tool_1") - assert len(tools) == 1 - tool = tools[0] - assert tool is not None - assert isinstance(tool, Tool) - assert tool.name == "tool_1" - - tools = get_tool("unknown tool") - assert not tools - - -def test_tool_creation() -> None: - """Test edge cases when creating a Tool instance.""" - with pytest.raises(ConfigurationException): - Tool(ToolConfig(name="test", commands={"test": []})) # no 'run' command |