mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix config option to disable built-in templates.
This commit is contained in:
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:
|
||||
|
||||
|
||||
Reference in new issue
Block a user