mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Use aiosqlite and add service for templates
This commit is contained in:
1 parent
d730c591b3
commit
0fea3f969e
14 files changed
+290
-230
No files matched your search
@@ -23,7 +23,7 @@ from fastapi import FastAPI, status
|
||||
from httpx import AsyncClient
|
||||
|
||||
from gns3server.controller import Controller
|
||||
from gns3server.db.repositories.templates import BUILTIN_TEMPLATES
|
||||
from gns3server.services.templates import BUILTIN_TEMPLATES
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ async def app() -> FastAPI:
|
||||
@pytest.fixture(scope="class")
|
||||
def db_engine():
|
||||
|
||||
db_url = os.getenv("GNS3_TEST_DATABASE_URI", "sqlite:///:memory:") # "sqlite:///./sql_test_app.db"
|
||||
db_url = os.getenv("GNS3_TEST_DATABASE_URI", "sqlite+aiosqlite:///:memory:") # "sqlite:///./sql_test_app.db"
|
||||
engine = create_async_engine(db_url, connect_args={"check_same_thread": False}, future=True)
|
||||
yield engine
|
||||
engine.sync_engine.dispose()
|
||||
|
||||
Reference in new issue
Block a user