diff --git a/tests/api/routes/controller/test_appliances.py b/tests/api/routes/controller/test_appliances.py index 089466c2..ef61fb0f 100644 --- a/tests/api/routes/controller/test_appliances.py +++ b/tests/api/routes/controller/test_appliances.py @@ -21,12 +21,19 @@ import shutil from fastapi import FastAPI, status from httpx import AsyncClient +from gns3server.controller import Controller pytestmark = pytest.mark.asyncio class TestApplianceRoutes: + @pytest.fixture(autouse=True) + def _install_builtin_appliances(self, controller: Controller): + + controller.appliance_manager.install_builtin_appliances() + controller.appliance_manager.load_appliances() + async def test_appliances_list(self, app: FastAPI, client: AsyncClient) -> None: response = await client.get(app.url_path_for("get_appliances")) diff --git a/tests/api/routes/controller/test_images.py b/tests/api/routes/controller/test_images.py index 4ca09389..7aa09f22 100644 --- a/tests/api/routes/controller/test_images.py +++ b/tests/api/routes/controller/test_images.py @@ -263,6 +263,7 @@ class TestImageRoutes: controller: Controller ) -> None: + controller.appliance_manager.install_builtin_appliances() controller.appliance_manager.load_appliances() # make sure appliances are loaded image_path = "tests/resources/empty30G.qcow2" image_name = os.path.basename(image_path) diff --git a/tests/controller/test_controller.py b/tests/controller/test_controller.py index ab62adb9..63987dfb 100644 --- a/tests/controller/test_controller.py +++ b/tests/controller/test_controller.py @@ -380,6 +380,7 @@ def test_appliances(controller, config, tmpdir): json.dump(my_appliance, f) config.settings.Server.appliances_path = str(tmpdir) + controller.appliance_manager.install_builtin_appliances() controller.appliance_manager.load_appliances() assert len(controller.appliance_manager.appliances) > 0 for appliance in controller.appliance_manager.appliances.values():