From 014e24cc4819aa8ddac3bc4e83282e1e2a93edc0 Mon Sep 17 00:00:00 2001 From: MarcoFavorito Date: Fri, 20 Dec 2019 20:12:48 +0100 Subject: [PATCH 1/2] fix package path and gui test issues. --- aea/cli/common.py | 3 +-- aea/cli/search.py | 18 +++++++----------- aea/cli_gui/__init__.py | 7 ++++--- tests/test_gui/test_add.py | 22 ++++++++-------------- tests/test_gui/test_create.py | 8 +++++++- tests/test_gui/test_run_agent.py | 9 ++++++++- 6 files changed, 35 insertions(+), 32 deletions(-) diff --git a/aea/cli/common.py b/aea/cli/common.py index 8684b38407..3143d147c1 100644 --- a/aea/cli/common.py +++ b/aea/cli/common.py @@ -31,7 +31,6 @@ import jsonschema # type: ignore from dotenv import load_dotenv -import aea from aea.cli.loggers import default_logging_config from aea.configurations.base import DEFAULT_AEA_CONFIG_FILE, AgentConfig, SkillConfig, ConnectionConfig, ProtocolConfig, \ DEFAULT_PROTOCOL_CONFIG_FILE, DEFAULT_CONNECTION_CONFIG_FILE, DEFAULT_SKILL_CONFIG_FILE, Dependencies @@ -40,7 +39,7 @@ logger = logging.getLogger("aea") logger = default_logging_config(logger) -DEFAULT_REGISTRY_PATH = str(Path(aea.AEA_DIR, "..", "packages").resolve()) +DEFAULT_REGISTRY_PATH = str(Path("..", "packages")) DEFAULT_CONNECTION = "stub" DEFAULT_SKILL = "error" diff --git a/aea/cli/search.py b/aea/cli/search.py index 9f44e1a9e3..194c23e7c0 100644 --- a/aea/cli/search.py +++ b/aea/cli/search.py @@ -18,15 +18,18 @@ # ------------------------------------------------------------------------------ """Implementation of the 'aea search' subcommand.""" +import os from pathlib import Path from typing import cast, List, Dict + import click -import os from aea import AEA_DIR -from aea.cli.common import Context, pass_ctx, DEFAULT_REGISTRY_PATH, logger, retrieve_details, ConfigLoader, format_items, format_skills -from aea.configurations.base import DEFAULT_CONNECTION_CONFIG_FILE, DEFAULT_SKILL_CONFIG_FILE, DEFAULT_PROTOCOL_CONFIG_FILE +from aea.cli.common import Context, pass_ctx, DEFAULT_REGISTRY_PATH, logger, retrieve_details, ConfigLoader, \ + format_items, format_skills from aea.cli.registry.utils import request_api +from aea.configurations.base import DEFAULT_CONNECTION_CONFIG_FILE, DEFAULT_SKILL_CONFIG_FILE, \ + DEFAULT_PROTOCOL_CONFIG_FILE @click.group() @@ -42,14 +45,7 @@ def search(ctx: Context, registry): if registry: ctx.set_config("is_registry", True) else: - # if the search is executed from an agent directory: - if hasattr(ctx, "agent_config"): - # take the path defined by the user, and distinguish between absolute and relative path. - path = Path(ctx.agent_config.registry_path) - registry = path if path.is_absolute() else Path(ctx.cwd) / path - else: - # use the default registry path. This works only for source installations. - registry = DEFAULT_REGISTRY_PATH + registry = os.path.join(ctx.cwd, DEFAULT_REGISTRY_PATH) ctx.set_config("registry", registry) logger.debug("Using registry {}".format(registry)) diff --git a/aea/cli_gui/__init__.py b/aea/cli_gui/__init__.py index 4b5d43e166..bc672ee167 100644 --- a/aea/cli_gui/__init__.py +++ b/aea/cli_gui/__init__.py @@ -132,14 +132,14 @@ def _sync_extract_items_from_tty(pid: subprocess.Popen): def get_registered_items(item_type: str): """Create a new AEA project.""" # need to place ourselves one directory down so the searcher can find the packages - pid = _call_aea_async([sys.executable, "-m", "aea.cli", "search", item_type + "s"], app_context.agents_dir) + pid = _call_aea_async(["aea", "search", item_type + "s"], os.path.join(app_context.agents_dir, "aea")) return _sync_extract_items_from_tty(pid) def search_registered_items(item_type: str, search_term: str): """Create a new AEA project.""" # need to place ourselves one directory down so the searcher can find the packages - pid = _call_aea_async([sys.executable, "-m", "aea.cli", "search", item_type + "s", "--query", search_term], app_context.agents_dir) + pid = _call_aea_async(["aea", "search", item_type + "s", "--query", search_term], os.path.join(app_context.agents_dir, "aea")) ret = _sync_extract_items_from_tty(pid) search_result, status = ret response = {"search_result": search_result, "item_type": item_type, "search_term": search_term} @@ -165,7 +165,7 @@ def delete_agent(agent_id: str): def add_item(agent_id: str, item_type: str, item_id: str): """Add a protocol, skill or connection to the register to a local agent.""" agent_dir = os.path.join(app_context.agents_dir, agent_id) - if _call_aea([sys.executable, "-m", "aea.cli", "add", item_type, item_id], agent_dir) == 0: + if _call_aea(["aea", "add", item_type, item_id], agent_dir) == 0: return agent_id, 201 # 200 (OK) else: return {"detail": "Failed to add {} {} to agent {}".format(item_type, item_id, agent_id)}, 400 # 400 Bad request @@ -204,6 +204,7 @@ def _call_aea(param_list: List[str], dir_arg: str) -> int: old_cwd = os.getcwd() os.chdir(dir_arg) ret = subprocess.call(param_list) + subprocess.Popen(param_list, stderr=subprocess.PIPE, stdout=subprocess.PIPE).communicate() os.chdir(old_cwd) return ret diff --git a/tests/test_gui/test_add.py b/tests/test_gui/test_add.py index 15d704c137..0c2a7fb62f 100644 --- a/tests/test_gui/test_add.py +++ b/tests/test_gui/test_add.py @@ -20,8 +20,6 @@ """This test module contains the tests for the `aea gui` sub-commands.""" import json -import sys - import unittest.mock from .test_base import create_app @@ -38,12 +36,10 @@ def test_add_item(): connection_name = "test_connection" def _dummy_call_aea(param_list, dir): - assert param_list[0] == sys.executable - assert param_list[1] == "-m" - assert param_list[2] == "aea.cli" - assert param_list[3] == "add" - assert param_list[4] == "connection" - assert param_list[5] == connection_name + assert param_list[0] == "aea" + assert param_list[1] == "add" + assert param_list[2] == "connection" + assert param_list[3] == connection_name assert agent_name in dir return 0 @@ -69,12 +65,10 @@ def test_delete_agent_fail(): connection_name = "test_connection" def _dummy_call_aea(param_list, dir): - assert param_list[0] == sys.executable - assert param_list[1] == "-m" - assert param_list[2] == "aea.cli" - assert param_list[3] == "add" - assert param_list[4] == "connection" - assert param_list[5] == connection_name + assert param_list[0] == "aea" + assert param_list[1] == "add" + assert param_list[2] == "connection" + assert param_list[3] == connection_name assert agent_name in dir return 1 diff --git a/tests/test_gui/test_create.py b/tests/test_gui/test_create.py index 0282e78093..9ea2ac543e 100644 --- a/tests/test_gui/test_create.py +++ b/tests/test_gui/test_create.py @@ -19,12 +19,15 @@ """This test module contains the tests for the `aea gui` sub-commands.""" import json +import shutil import sys import time import unittest.mock +from pathlib import Path from .test_base import create_app, TempCWD +from ..conftest import CUR_PATH def test_create_agent(): @@ -78,9 +81,12 @@ def _dummy_call_aea(param_list, dir): def test_real_create(): """Really create an agent (have to test the call_aea at some point).""" # Set up a temporary current working directory to make agents in - with TempCWD(): + with TempCWD() as temp_cwd: app = create_app() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(temp_cwd.temp_dir, "packages")) + agent_id = "test_agent_id" response_create = app.post( 'api/agent', diff --git a/tests/test_gui/test_run_agent.py b/tests/test_gui/test_run_agent.py index bcaa0965a4..f98667dc5d 100644 --- a/tests/test_gui/test_run_agent.py +++ b/tests/test_gui/test_run_agent.py @@ -19,21 +19,28 @@ """This test module contains the tests for the `aea gui` sub-commands.""" import json +import shutil import sys import time import unittest.mock +from pathlib import Path + import aea from .test_base import create_app, TempCWD +from ..conftest import CUR_PATH def test_create_and_run_agent(): """Test for running and agent, reading TTY and errors.""" # Set up a temporary current working directory in which to make agents - with TempCWD(): + with TempCWD() as temp_cwd: app = create_app() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(temp_cwd.temp_dir, "packages")) + agent_id = "test_agent" # Make an agent From b909ebf11eaa49f764b33e03b1ecbffd9c143fb0 Mon Sep 17 00:00:00 2001 From: MarcoFavorito Date: Fri, 20 Dec 2019 22:39:46 +0100 Subject: [PATCH 2/2] update tests that read from packages to use the relative path. --- tests/test_cli/test_add/test_connection.py | 14 ++++- tests/test_cli/test_add/test_protocol.py | 14 ++++- tests/test_cli/test_add/test_skill.py | 19 ++++-- tests/test_cli/test_add_key.py | 2 +- tests/test_cli/test_config.py | 2 +- tests/test_cli/test_create.py | 2 +- tests/test_cli/test_delete.py | 2 +- tests/test_cli/test_freeze.py | 2 +- tests/test_cli/test_generate_key.py | 2 +- tests/test_cli/test_gui.py | 2 +- tests/test_cli/test_install.py | 2 +- tests/test_cli/test_list.py | 2 +- tests/test_cli/test_login.py | 2 +- tests/test_cli/test_remove/test_connection.py | 6 +- tests/test_cli/test_remove/test_protocol.py | 6 +- tests/test_cli/test_remove/test_skill.py | 2 +- tests/test_cli/test_run.py | 62 ++++++++++++++++++- .../test_cli/test_scaffold/test_connection.py | 2 +- .../test_cli/test_scaffold/test_protocols.py | 2 +- tests/test_cli/test_scaffold/test_skills.py | 2 +- tests/test_cli/test_search.py | 2 +- tests/test_crypto/test_helpers.py | 2 +- tests/test_crypto/test_ledger_apis.py | 2 +- tests/test_decision_maker/test_base.py | 2 +- .../test_connections/test_tcp/test_base.py | 2 +- .../test_tcp/test_communication.py | 2 +- .../test_packages/test_skills/test_carpark.py | 2 +- tests/test_packages/test_skills/test_echo.py | 2 +- tests/test_packages/test_skills/test_gym.py | 2 +- .../test_skills/test_ml_skills.py | 2 +- .../test_packages/test_skills/test_weather.py | 2 +- .../test_skills/test_weather_ledger.py | 2 +- tests/test_skills/test_base.py | 2 +- 33 files changed, 137 insertions(+), 38 deletions(-) diff --git a/tests/test_cli/test_add/test_connection.py b/tests/test_cli/test_add/test_connection.py index f454932515..e2dd26c3d7 100644 --- a/tests/test_cli/test_add/test_connection.py +++ b/tests/test_cli/test_add/test_connection.py @@ -31,7 +31,7 @@ import aea.cli.common import aea.configurations.base from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION +from ...conftest import CLI_LOG_OPTION, CUR_PATH class TestAddConnectionFailsWhenConnectionAlreadyExists: @@ -48,6 +48,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -116,6 +119,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -158,6 +164,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -206,6 +215,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 diff --git a/tests/test_cli/test_add/test_protocol.py b/tests/test_cli/test_add/test_protocol.py index 231510d261..6c44c0a5b2 100644 --- a/tests/test_cli/test_add/test_protocol.py +++ b/tests/test_cli/test_add/test_protocol.py @@ -31,7 +31,7 @@ import aea.cli.common import aea.configurations.base from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION +from ...conftest import CLI_LOG_OPTION, CUR_PATH class TestAddProtocolFailsWhenProtocolAlreadyExists: @@ -48,6 +48,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -114,6 +117,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -156,6 +162,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -204,6 +213,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 diff --git a/tests/test_cli/test_add/test_skill.py b/tests/test_cli/test_add/test_skill.py index 62ea9169db..450f75c814 100644 --- a/tests/test_cli/test_add/test_skill.py +++ b/tests/test_cli/test_add/test_skill.py @@ -32,7 +32,7 @@ import aea.cli.common from aea.cli import cli from aea.configurations.base import AgentConfig, DEFAULT_AEA_CONFIG_FILE -from tests.conftest import ROOT_DIR, CLI_LOG_OPTION +from ...conftest import ROOT_DIR, CLI_LOG_OPTION, CUR_PATH class TestAddSkillFailsWhenSkillAlreadyExists: @@ -49,17 +49,15 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) # this also by default adds the oef connection and error skill assert result.exit_code == 0 os.chdir(cls.agent_name) - # change default registry path - config = AgentConfig.from_json(yaml.safe_load(open(DEFAULT_AEA_CONFIG_FILE))) - config.registry_path = os.path.join(ROOT_DIR, "packages") - yaml.safe_dump(config.json, open(DEFAULT_AEA_CONFIG_FILE, "w")) - # add the error skill again cls.result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "add", "skill", cls.skill_name], standalone_mode=False) @@ -121,6 +119,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -163,6 +164,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -216,6 +220,9 @@ def setup_class(cls): cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 diff --git a/tests/test_cli/test_add_key.py b/tests/test_cli/test_add_key.py index 0377b3a140..7a53e07a67 100644 --- a/tests/test_cli/test_add_key.py +++ b/tests/test_cli/test_add_key.py @@ -33,7 +33,7 @@ from aea.crypto.ethereum import ETHEREUM from aea.crypto.fetchai import FetchAICrypto, FETCHAI from aea.crypto.helpers import DEFAULT_PRIVATE_KEY_FILE, FETCHAI_PRIVATE_KEY_FILE, ETHEREUM_PRIVATE_KEY_FILE -from tests.conftest import CLI_LOG_OPTION +from ..conftest import CLI_LOG_OPTION from ..common.click_testing import CliRunner diff --git a/tests/test_cli/test_config.py b/tests/test_cli/test_config.py index 6ddd3272b7..d440ba662b 100644 --- a/tests/test_cli/test_config.py +++ b/tests/test_cli/test_config.py @@ -26,7 +26,7 @@ import aea.cli.common from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION, CUR_PATH +from ..conftest import CLI_LOG_OPTION, CUR_PATH from ..common.click_testing import CliRunner diff --git a/tests/test_cli/test_create.py b/tests/test_cli/test_create.py index 7acf6a254c..47253c55cf 100644 --- a/tests/test_cli/test_create.py +++ b/tests/test_cli/test_create.py @@ -39,7 +39,7 @@ from aea.cli import cli from aea.configurations.base import DEFAULT_AEA_CONFIG_FILE from aea.configurations.loader import ConfigLoader -from tests.conftest import AGENT_CONFIGURATION_SCHEMA, ROOT_DIR, CONFIGURATION_SCHEMA_DIR, CLI_LOG_OPTION +from ..conftest import AGENT_CONFIGURATION_SCHEMA, ROOT_DIR, CONFIGURATION_SCHEMA_DIR, CLI_LOG_OPTION class TestCreate: diff --git a/tests/test_cli/test_delete.py b/tests/test_cli/test_delete.py index b4069b8df0..cabe18e5eb 100644 --- a/tests/test_cli/test_delete.py +++ b/tests/test_cli/test_delete.py @@ -29,7 +29,7 @@ import aea import aea.cli.common from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION +from ..conftest import CLI_LOG_OPTION class TestDelete: diff --git a/tests/test_cli/test_freeze.py b/tests/test_cli/test_freeze.py index e88c5fa299..39fe16f777 100644 --- a/tests/test_cli/test_freeze.py +++ b/tests/test_cli/test_freeze.py @@ -26,7 +26,7 @@ from jsonschema import Draft4Validator from aea.cli import cli -from tests.conftest import AGENT_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR, CLI_LOG_OPTION, CUR_PATH +from ..conftest import AGENT_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR, CLI_LOG_OPTION, CUR_PATH from ..common.click_testing import CliRunner diff --git a/tests/test_cli/test_generate_key.py b/tests/test_cli/test_generate_key.py index e617731a67..f6aeb11a21 100644 --- a/tests/test_cli/test_generate_key.py +++ b/tests/test_cli/test_generate_key.py @@ -28,7 +28,7 @@ from aea.crypto.ethereum import EthereumCrypto from aea.crypto.fetchai import FetchAICrypto from aea.crypto.helpers import DEFAULT_PRIVATE_KEY_FILE, FETCHAI_PRIVATE_KEY_FILE, ETHEREUM_PRIVATE_KEY_FILE -from tests.conftest import CLI_LOG_OPTION +from ..conftest import CLI_LOG_OPTION from ..common.click_testing import CliRunner diff --git a/tests/test_cli/test_gui.py b/tests/test_cli/test_gui.py index 098693935b..0977def46c 100644 --- a/tests/test_cli/test_gui.py +++ b/tests/test_cli/test_gui.py @@ -30,7 +30,7 @@ import pytest from jsonschema import Draft4Validator -from tests.conftest import AGENT_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR, CLI_LOG_OPTION, tcpping +from ..conftest import AGENT_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR, CLI_LOG_OPTION, tcpping class TestGui: diff --git a/tests/test_cli/test_install.py b/tests/test_cli/test_install.py index 95f1bb5c96..e75813b9ec 100644 --- a/tests/test_cli/test_install.py +++ b/tests/test_cli/test_install.py @@ -29,7 +29,7 @@ import aea.cli.common from aea.cli import cli from aea.configurations.base import DEFAULT_PROTOCOL_CONFIG_FILE -from tests.conftest import CLI_LOG_OPTION, CUR_PATH +from ..conftest import CLI_LOG_OPTION, CUR_PATH class TestInstall: diff --git a/tests/test_cli/test_list.py b/tests/test_cli/test_list.py index 587ede140a..1f18f0f084 100644 --- a/tests/test_cli/test_list.py +++ b/tests/test_cli/test_list.py @@ -28,7 +28,7 @@ from jsonschema import Draft4Validator from aea.cli import cli -from tests.conftest import AGENT_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR, CLI_LOG_OPTION, CUR_PATH +from ..conftest import AGENT_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR, CLI_LOG_OPTION, CUR_PATH from tests.test_cli.constants import FORMAT_ITEMS_SAMPLE_OUTPUT diff --git a/tests/test_cli/test_login.py b/tests/test_cli/test_login.py index ec30c445b9..ce16974b8f 100644 --- a/tests/test_cli/test_login.py +++ b/tests/test_cli/test_login.py @@ -22,7 +22,7 @@ from aea.cli import cli from tests.common.click_testing import CliRunner -from tests.conftest import CLI_LOG_OPTION +from ..conftest import CLI_LOG_OPTION @mock.patch('aea.cli.login.registry_login', return_value='token') diff --git a/tests/test_cli/test_remove/test_connection.py b/tests/test_cli/test_remove/test_connection.py index 990067a018..21e63c84c8 100644 --- a/tests/test_cli/test_remove/test_connection.py +++ b/tests/test_cli/test_remove/test_connection.py @@ -32,7 +32,7 @@ import aea.configurations.base from aea.cli import cli from aea.configurations.base import DEFAULT_AEA_CONFIG_FILE -from tests.conftest import CLI_LOG_OPTION +from ...conftest import CLI_LOG_OPTION, CUR_PATH class TestRemoveConnection: @@ -45,6 +45,8 @@ def setup_class(cls): cls.agent_name = "myagent" cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) cls.connection_name = "local" cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() @@ -133,6 +135,8 @@ def setup_class(cls): cls.agent_name = "myagent" cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) cls.connection_name = "local" cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() diff --git a/tests/test_cli/test_remove/test_protocol.py b/tests/test_cli/test_remove/test_protocol.py index ef4de0135f..e6ed40bd15 100644 --- a/tests/test_cli/test_remove/test_protocol.py +++ b/tests/test_cli/test_remove/test_protocol.py @@ -32,7 +32,7 @@ import aea.configurations.base from aea.cli import cli from aea.configurations.base import DEFAULT_AEA_CONFIG_FILE -from tests.conftest import CLI_LOG_OPTION +from ...conftest import CLI_LOG_OPTION, CUR_PATH class TestRemoveProtocol: @@ -45,6 +45,8 @@ def setup_class(cls): cls.agent_name = "myagent" cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) cls.protocol_name = "gym" cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() @@ -133,6 +135,8 @@ def setup_class(cls): cls.agent_name = "myagent" cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) cls.protocol_name = "gym" cls.patch = unittest.mock.patch.object(aea.cli.common.logger, 'error') cls.mocked_logger_error = cls.patch.__enter__() diff --git a/tests/test_cli/test_remove/test_skill.py b/tests/test_cli/test_remove/test_skill.py index f53b8c605e..73da79219b 100644 --- a/tests/test_cli/test_remove/test_skill.py +++ b/tests/test_cli/test_remove/test_skill.py @@ -32,7 +32,7 @@ import aea.configurations.base from aea.cli import cli from aea.configurations.base import DEFAULT_AEA_CONFIG_FILE, AgentConfig -from tests.conftest import ROOT_DIR, CLI_LOG_OPTION +from ...conftest import ROOT_DIR, CLI_LOG_OPTION class TestRemoveSkill: diff --git a/tests/test_cli/test_run.py b/tests/test_cli/test_run.py index 35755eb34a..8e95f38c16 100644 --- a/tests/test_cli/test_run.py +++ b/tests/test_cli/test_run.py @@ -36,7 +36,7 @@ from aea.cli import cli from aea.configurations.base import DEFAULT_AEA_CONFIG_FILE, DEFAULT_CONNECTION_CONFIG_FILE -from tests.conftest import CLI_LOG_OPTION, CUR_PATH +from ..conftest import CLI_LOG_OPTION, CUR_PATH def test_run(pytestconfig): @@ -48,6 +48,9 @@ def test_run(pytestconfig): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -101,6 +104,9 @@ def test_run_multiple_connections(pytestconfig, connection_names): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -153,6 +159,9 @@ def test_run_unknown_private_key(pytestconfig): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -210,6 +219,9 @@ def test_run_unknown_ledger(pytestconfig): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -265,6 +277,9 @@ def test_run_default_private_key_config(pytestconfig): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -318,6 +333,9 @@ def test_run_fet_private_key_config(pytestconfig): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -371,6 +389,9 @@ def test_run_ethereum_private_key_config(pytestconfig): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -424,6 +445,9 @@ def test_run_ledger_apis(pytestconfig): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -498,6 +522,9 @@ def test_run_fet_ledger_apis(pytestconfig): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -568,6 +595,9 @@ def test_run_with_install_deps(pytestconfig): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -615,6 +645,9 @@ def test_run_with_install_deps_and_requirement_file(pytestconfig): agent_name = "myagent" cwd = os.getcwd() t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(t, "packages")) + os.chdir(t) result = runner.invoke(cli, [*CLI_LOG_OPTION, "create", agent_name]) assert result.exit_code == 0 @@ -668,6 +701,9 @@ def setup_class(cls): cls.agent_name = "myagent" cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -714,6 +750,9 @@ def setup_class(cls): cls.mocked_logger_error = cls.patch.__enter__() cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -758,6 +797,9 @@ def setup_class(cls): cls.mocked_logger_error = cls.patch.__enter__() cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -804,6 +846,9 @@ def setup_class(cls): cls.mocked_logger_error = cls.patch.__enter__() cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -848,6 +893,9 @@ def setup_class(cls): cls.mocked_logger_error = cls.patch.__enter__() cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -894,6 +942,9 @@ def setup_class(cls): cls.mocked_logger_error = cls.patch.__enter__() cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -940,6 +991,9 @@ def setup_class(cls): cls.mocked_logger_error = cls.patch.__enter__() cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -986,6 +1040,9 @@ def setup_class(cls): cls.mocked_logger_error = cls.patch.__enter__() cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 @@ -1031,6 +1088,9 @@ def setup_class(cls): cls.mocked_logger_error = cls.patch.__enter__() cls.cwd = os.getcwd() cls.t = tempfile.mkdtemp() + # copy the 'packages' directory in the parent of the agent folder. + shutil.copytree(Path(CUR_PATH, "..", "packages"), Path(cls.t, "packages")) + os.chdir(cls.t) result = cls.runner.invoke(cli, [*CLI_LOG_OPTION, "create", cls.agent_name], standalone_mode=False) assert result.exit_code == 0 diff --git a/tests/test_cli/test_scaffold/test_connection.py b/tests/test_cli/test_scaffold/test_connection.py index 63913060d8..f2d484adc7 100644 --- a/tests/test_cli/test_scaffold/test_connection.py +++ b/tests/test_cli/test_scaffold/test_connection.py @@ -36,7 +36,7 @@ import aea.configurations.base from aea.configurations.base import DEFAULT_CONNECTION_CONFIG_FILE from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION, CONNECTION_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR +from ...conftest import CLI_LOG_OPTION, CONNECTION_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR class TestScaffoldConnection: diff --git a/tests/test_cli/test_scaffold/test_protocols.py b/tests/test_cli/test_scaffold/test_protocols.py index 00aff7276f..a800ca8ac3 100644 --- a/tests/test_cli/test_scaffold/test_protocols.py +++ b/tests/test_cli/test_scaffold/test_protocols.py @@ -36,7 +36,7 @@ import aea.configurations.base from aea.configurations.base import DEFAULT_PROTOCOL_CONFIG_FILE from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION, PROTOCOL_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR +from ...conftest import CLI_LOG_OPTION, PROTOCOL_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR class TestScaffoldProtocol: diff --git a/tests/test_cli/test_scaffold/test_skills.py b/tests/test_cli/test_scaffold/test_skills.py index d2331da1b7..3111cdb74c 100644 --- a/tests/test_cli/test_scaffold/test_skills.py +++ b/tests/test_cli/test_scaffold/test_skills.py @@ -36,7 +36,7 @@ import aea.configurations.base from aea.configurations.base import DEFAULT_SKILL_CONFIG_FILE from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION, SKILL_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR +from ...conftest import CLI_LOG_OPTION, SKILL_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR class TestScaffoldSkill: diff --git a/tests/test_cli/test_search.py b/tests/test_cli/test_search.py index 3c218af7c9..73c99e9fcb 100644 --- a/tests/test_cli/test_search.py +++ b/tests/test_cli/test_search.py @@ -29,7 +29,7 @@ from aea import AEA_DIR from aea.cli import cli -from tests.conftest import AGENT_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR, CLI_LOG_OPTION +from ..conftest import AGENT_CONFIGURATION_SCHEMA, CONFIGURATION_SCHEMA_DIR, CLI_LOG_OPTION from tests.test_cli.constants import FORMAT_ITEMS_SAMPLE_OUTPUT diff --git a/tests/test_crypto/test_helpers.py b/tests/test_crypto/test_helpers.py index ce6da23a50..3f7229231c 100644 --- a/tests/test_crypto/test_helpers.py +++ b/tests/test_crypto/test_helpers.py @@ -26,7 +26,7 @@ from aea.crypto.helpers import _try_validate_private_key_pem_path, _try_validate_fet_private_key_path, \ _try_validate_ethereum_private_key_path -from tests.conftest import CUR_PATH +from ..conftest import CUR_PATH logger = logging.getLogger(__name__) diff --git a/tests/test_crypto/test_ledger_apis.py b/tests/test_crypto/test_ledger_apis.py index b90974fb14..798e01ae34 100644 --- a/tests/test_crypto/test_ledger_apis.py +++ b/tests/test_crypto/test_ledger_apis.py @@ -32,7 +32,7 @@ from aea.crypto.ledger_apis import LedgerApis, DEFAULT_FETCHAI_CONFIG, \ _try_to_instantiate_fetchai_ledger_api, \ _try_to_instantiate_ethereum_ledger_api -from tests.conftest import CUR_PATH +from ..conftest import CUR_PATH logger = logging.getLogger(__name__) diff --git a/tests/test_decision_maker/test_base.py b/tests/test_decision_maker/test_base.py index c377065a10..4dc10c2393 100644 --- a/tests/test_decision_maker/test_base.py +++ b/tests/test_decision_maker/test_base.py @@ -35,7 +35,7 @@ from aea.decision_maker.messages.transaction import TransactionMessage from aea.mail.base import OutBox, Multiplexer # , Envelope from aea.protocols.default.message import DefaultMessage -from tests.conftest import CUR_PATH, DummyConnection +from ..conftest import CUR_PATH, DummyConnection MAX_REACTIONS = 10 diff --git a/tests/test_packages/test_connections/test_tcp/test_base.py b/tests/test_packages/test_connections/test_tcp/test_base.py index a8ae1dcc72..65631fbe29 100644 --- a/tests/test_packages/test_connections/test_tcp/test_base.py +++ b/tests/test_packages/test_connections/test_tcp/test_base.py @@ -29,7 +29,7 @@ from aea.mail.base import Envelope from packages.connections.tcp.tcp_client import TCPClientConnection from packages.connections.tcp.tcp_server import TCPServerConnection -from tests.conftest import get_unused_tcp_port +from ....conftest import get_unused_tcp_port @pytest.mark.asyncio diff --git a/tests/test_packages/test_connections/test_tcp/test_communication.py b/tests/test_packages/test_connections/test_tcp/test_communication.py index ff9c594acf..036c45e480 100644 --- a/tests/test_packages/test_connections/test_tcp/test_communication.py +++ b/tests/test_packages/test_connections/test_tcp/test_communication.py @@ -31,7 +31,7 @@ from aea.protocols.default.serialization import DefaultSerializer from packages.connections.tcp.tcp_client import TCPClientConnection from packages.connections.tcp.tcp_server import TCPServerConnection -from tests.conftest import get_unused_tcp_port +from ....conftest import get_unused_tcp_port class TestTCPCommunication: diff --git a/tests/test_packages/test_skills/test_carpark.py b/tests/test_packages/test_skills/test_carpark.py index 0a12df2e28..835224a133 100644 --- a/tests/test_packages/test_skills/test_carpark.py +++ b/tests/test_packages/test_skills/test_carpark.py @@ -35,7 +35,7 @@ from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION +from ...conftest import CLI_LOG_OPTION def _read_tty(pid: subprocess.Popen): diff --git a/tests/test_packages/test_skills/test_echo.py b/tests/test_packages/test_skills/test_echo.py index 4d0e98cf05..1b0a44d6c7 100644 --- a/tests/test_packages/test_skills/test_echo.py +++ b/tests/test_packages/test_skills/test_echo.py @@ -38,7 +38,7 @@ from aea.protocols.default.message import DefaultMessage from aea.protocols.default.serialization import DefaultSerializer -from tests.conftest import CLI_LOG_OPTION +from ...conftest import CLI_LOG_OPTION class TestEchoSkill: diff --git a/tests/test_packages/test_skills/test_gym.py b/tests/test_packages/test_skills/test_gym.py index e0eadadcd9..cc09d50f45 100644 --- a/tests/test_packages/test_skills/test_gym.py +++ b/tests/test_packages/test_skills/test_gym.py @@ -36,7 +36,7 @@ from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION +from ...conftest import CLI_LOG_OPTION class TestGymSkill: diff --git a/tests/test_packages/test_skills/test_ml_skills.py b/tests/test_packages/test_skills/test_ml_skills.py index 063f0bc1a7..b3940bb597 100644 --- a/tests/test_packages/test_skills/test_ml_skills.py +++ b/tests/test_packages/test_skills/test_ml_skills.py @@ -35,7 +35,7 @@ from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION +from ...conftest import CLI_LOG_OPTION def _read_tty(pid: subprocess.Popen): diff --git a/tests/test_packages/test_skills/test_weather.py b/tests/test_packages/test_skills/test_weather.py index 37d42b1c9d..fb005954c4 100644 --- a/tests/test_packages/test_skills/test_weather.py +++ b/tests/test_packages/test_skills/test_weather.py @@ -32,7 +32,7 @@ from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION +from ...conftest import CLI_LOG_OPTION class TestWeatherSkills: diff --git a/tests/test_packages/test_skills/test_weather_ledger.py b/tests/test_packages/test_skills/test_weather_ledger.py index 2cb7aa8a61..51a51d987b 100644 --- a/tests/test_packages/test_skills/test_weather_ledger.py +++ b/tests/test_packages/test_skills/test_weather_ledger.py @@ -35,7 +35,7 @@ from aea.cli import cli -from tests.conftest import CLI_LOG_OPTION +from ...conftest import CLI_LOG_OPTION def _read_tty(pid: subprocess.Popen): diff --git a/tests/test_skills/test_base.py b/tests/test_skills/test_base.py index 46a639ee26..d3fd8fe39d 100644 --- a/tests/test_skills/test_base.py +++ b/tests/test_skills/test_base.py @@ -32,7 +32,7 @@ from aea.crypto.ledger_apis import LedgerApis from aea.decision_maker.base import OwnershipState, Preferences, GoalPursuitReadiness from aea.skills.base import SkillContext, Skill -from tests.conftest import CUR_PATH, DummyConnection +from ..conftest import CUR_PATH, DummyConnection def test_agent_context_ledger_apis():