Use aiosqlite and add service for templates

This commit is contained in:
grossmj committed 2021-03-28 21:17:29 +10:30
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
View File
@@ -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()