- The audit-wording guard now reads both branches of a conditional action
("backup.made" if ok else "backup.failed"), and its self-test covers that.
- The Backups save test no longer asserts the session's tz, which sign-in
state sets, not the test.
- The restore integration test uses the app's own metadata. all_metadata
without plugin dirs imports the `plugins` package as the tests do; loading
by path under the loader's names is only for `steward restore`. Loading by
path in the shared test process had mapped traefik and unifi tables a
second time for later tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,8 @@ def app():
|
||||
def test_a_dangling_ansible_run_link_is_cleared_and_the_event_kept(app):
|
||||
from sqlalchemy import select, text
|
||||
|
||||
from steward.backup.restore import _execute, all_metadata, dangling_fixes
|
||||
from steward.backup.restore import _execute, dangling_fixes
|
||||
from steward.models.base import Base
|
||||
from steward.models.alerts import AlertEvent, AlertOperator, AlertRule
|
||||
from steward.models.users import User, UserRole
|
||||
|
||||
@@ -49,7 +50,7 @@ def test_a_dangling_ansible_run_link_is_cleared_and_the_event_kept(app):
|
||||
s.add(AlertEvent(id=plain, rule_id=rule_id, from_state="firing",
|
||||
to_state="inactive"))
|
||||
|
||||
fixed = await _execute(os.environ["STEWARD_DATABASE_URL"], dangling_fixes(all_metadata()))
|
||||
fixed = await _execute(os.environ["STEWARD_DATABASE_URL"], dangling_fixes(Base.metadata))
|
||||
|
||||
async with app.db_sessionmaker() as s:
|
||||
rows = dict((await s.execute(
|
||||
|
||||
Reference in New Issue
Block a user