fix: update test fixtures for SQLite storage migration
Some checks failed
Lint & Test / test (push) Failing after 1m33s

All store tests were passing file paths instead of Database objects
after the JSON-to-SQLite migration. Updated fixtures to create temp
Database instances, rewrote backup e2e tests for binary .db format,
and fixed config tests for the simplified StorageConfig.
This commit is contained in:
2026-03-25 11:38:07 +03:00
parent 9dfd2365f4
commit 2da5c047f9
12 changed files with 135 additions and 126 deletions

View File

@@ -7,8 +7,8 @@ from wled_controller.storage.sync_clock_store import SyncClockStore
@pytest.fixture
def store(tmp_path) -> SyncClockStore:
return SyncClockStore(str(tmp_path / "sync_clocks.json"))
def store(tmp_db) -> SyncClockStore:
return SyncClockStore(tmp_db)
# ---------------------------------------------------------------------------
@@ -149,12 +149,14 @@ class TestSyncClockNameUniqueness:
class TestSyncClockPersistence:
def test_persist_and_reload(self, tmp_path):
path = str(tmp_path / "sc_persist.json")
s1 = SyncClockStore(path)
from wled_controller.storage.database import Database
db = Database(tmp_path / "sc_persist.db")
s1 = SyncClockStore(db)
c = s1.create_clock(name="Persist", speed=2.5)
cid = c.id
s2 = SyncClockStore(path)
s2 = SyncClockStore(db)
loaded = s2.get_clock(cid)
assert loaded.name == "Persist"
assert loaded.speed == 2.5
db.close()