Fix config option to disable built-in templates.

This commit is contained in:
grossmj committed 2022-06-21 17:17:44 +02:00
1 parent d8b928f1c1
commit 410f062721
3 files changed
+18 -2

No files matched your search

@@ -28,6 +28,7 @@ from tests.utils import asyncio_patch
from gns3server.db.repositories.images import ImagesRepository
from gns3server.db.repositories.templates import TemplatesRepository
from gns3server.controller import Controller
from gns3server.controller import Config
from gns3server.services.templates import BUILTIN_TEMPLATES
pytestmark = pytest.mark.asyncio
@@ -257,6 +258,18 @@ class TestBuiltinTemplates:
response = await client.delete(app.url_path_for("delete_template", template_id=template_id))
assert response.status_code == status.HTTP_403_FORBIDDEN
async def test_list_builtin_templates_not_enabled(
self,
app: FastAPI,
client: AsyncClient,
controller: Controller
) -> None:
config = Config.instance()
config.settings.Server.enable_builtin_templates = False
response = await client.get(app.url_path_for("get_templates"))
assert not response.json()
class TestDynamipsTemplate: