feat: add backup monitoring database schema
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from media_library_viewer_api.services.settings_store import SettingsStore
|
||||
|
||||
|
||||
def test_backup_schema_created():
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
db_path = Path(tmpdir) / "test_settings.sqlite"
|
||||
store = SettingsStore(db_path)
|
||||
store.init_schema()
|
||||
with store.connect() as conn:
|
||||
tables = conn.execute("SELECT name FROM sqlite_master WHERE type='table' AND name LIKE 'backup_%'").fetchall()
|
||||
table_names = [t[0] for t in tables]
|
||||
assert "backup_jobs" in table_names
|
||||
assert "backup_runs" in table_names
|
||||
assert "backup_alerts" in table_names
|
||||
Reference in New Issue
Block a user