mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 17:55:26 -04:00
test: pilot core database stub helper (#3685)
This commit is contained in:
committed by
GitHub
parent
b1af29c7bc
commit
a22c0fa85e
@@ -1,17 +1,15 @@
|
||||
import sys
|
||||
from types import ModuleType
|
||||
from types import SimpleNamespace
|
||||
|
||||
from tests.helpers.cli_loader import load_script
|
||||
from tests.helpers.db_stubs import make_core_db_stub
|
||||
|
||||
|
||||
def _load_sessions_cli(monkeypatch):
|
||||
core_mod = ModuleType("core")
|
||||
database_mod = ModuleType("core.database")
|
||||
database_mod.SessionLocal = object
|
||||
database_mod.Session = object
|
||||
monkeypatch.setitem(sys.modules, "core", core_mod)
|
||||
monkeypatch.setitem(sys.modules, "core.database", database_mod)
|
||||
make_core_db_stub(
|
||||
monkeypatch,
|
||||
attributes={"SessionLocal": object, "Session": object},
|
||||
install_core_package=True,
|
||||
)
|
||||
return load_script("odysseus-sessions")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user