File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
services/web/server/tests/unit/with_dbs/01 Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 77
88import yaml
99from aiohttp .test_utils import TestServer
10+ from simcore_service_webserver .application_settings import (
11+ ApplicationSettings ,
12+ get_application_settings ,
13+ )
1014from simcore_service_webserver .db .plugin import (
15+ get_async_engine ,
1116 is_service_enabled ,
1217 is_service_responsive ,
1318)
19+ from sqlalchemy .ext .asyncio import AsyncEngine
1420
1521
1622def test_uses_same_postgres_version (
1723 docker_compose_file : Path , osparc_simcore_root_dir : Path
1824):
19- with open (docker_compose_file ) as fh :
25+ with Path . open (docker_compose_file ) as fh :
2026 fixture = yaml .safe_load (fh )
2127
22- with open (osparc_simcore_root_dir / "services" / "docker-compose.yml" ) as fh :
28+ with Path . open (osparc_simcore_root_dir / "services" / "docker-compose.yml" ) as fh :
2329 expected = yaml .safe_load (fh )
2430
2531 assert (
@@ -32,3 +38,16 @@ async def test_responsive(web_server: TestServer):
3238 app = web_server .app
3339 assert is_service_enabled (app )
3440 assert await is_service_responsive (app )
41+
42+
43+ def test_async_engine (web_server : TestServer ):
44+ app = web_server .app
45+ assert app
46+ settings : ApplicationSettings = get_application_settings (app )
47+
48+ # same as host
49+ assert settings .WEBSERVER_DB
50+ assert settings .WEBSERVER_DB .POSTGRES_CLIENT_NAME
51+
52+ engine : AsyncEngine = get_async_engine (app )
53+ assert engine
You can’t perform that action at this time.
0 commit comments