Skip to content

Commit

Permalink
feat: add support for PilotLogsDB in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martynia committed Aug 9, 2024
1 parent 02c24a9 commit b8be1dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions diracx-testing/src/diracx/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def __init__(
from diracx.core.extensions import select_from_extension
from diracx.core.settings import ServiceSettingsBase
from diracx.db.sql.utils import BaseSQLDB
from diracx.db.os.utils import BaseOSDB
from diracx.routers import create_app_inner
from diracx.routers.access_policies import BaseAccessPolicy

Expand Down Expand Up @@ -186,6 +187,7 @@ def enrich_tokens(access_payload: dict, refresh_payload: dict):
database_urls=database_urls,
os_database_conn_kwargs={
# TODO: JobParametersDB
"PilotLogsDB": {}
},
config_source=ConfigSource.create_from_url(
backend_url=f"git+file://{with_config_repo}"
Expand All @@ -198,14 +200,14 @@ def enrich_tokens(access_payload: dict, refresh_payload: dict):
for obj in self.all_dependency_overrides:
assert issubclass(
obj.__self__,
(ServiceSettingsBase, BaseSQLDB, ConfigSource, BaseAccessPolicy),
(ServiceSettingsBase, BaseSQLDB, BaseOSDB, ConfigSource, BaseAccessPolicy),
), obj

self.all_lifetime_functions = self.app.lifetime_functions[:]
self.app.lifetime_functions = []
for obj in self.all_lifetime_functions:
assert isinstance(
obj.__self__, (ServiceSettingsBase, BaseSQLDB, ConfigSource)
obj.__self__, (ServiceSettingsBase, BaseSQLDB, BaseOSDB, ConfigSource)
), obj

@contextlib.contextmanager
Expand Down

0 comments on commit b8be1dd

Please sign in to comment.