test: account for pending publication table

This commit is contained in:
xavierk
2026-09-28 03:23:46 +05:30
parent 0d45f263d2
commit 847bde1be0
2 changed files with 4 additions and 4 deletions
+2 -3
View File
@@ -3,8 +3,7 @@
This module handles:
- Store initialization with WAL mode
- Schema versioning with PRAGMA user_version
- The six entities: samples, hour_observations, day_aggregates,
monitoring_periods, controller_segments, endurance_baseline
- Observation records, derived activity, publication state, and metadata
"""
import sqlite3
from pathlib import Path
@@ -33,7 +32,7 @@ def get_store_path(config: dict) -> Path:
def init_store(store_path: Path) -> sqlite3.Connection:
"""Initialize the observation store if not present.
Creates the database with WAL mode and all six entities.
Creates the observation schema, including private pending-publication storage.
Returns a connection to the store.
"""
conn = sqlite3.connect(str(store_path))
+2 -1
View File
@@ -232,7 +232,7 @@ def test_store_initialization(config_fixture: Dict[str, Any]):
# Initialize store
conn = init_store(store_path)
# Verify all six entities exist
# Verify the observation, derived-history, and metadata tables exist.
cursor = conn.execute("SELECT name FROM sqlite_master WHERE type='table'")
tables = {row[0] for row in cursor.fetchall()}
@@ -249,6 +249,7 @@ def test_store_initialization(config_fixture: Dict[str, Any]):
expected_tables.add("sqlite_sequence")
expected_tables.add("store_metadata")
expected_tables.add("local_days")
expected_tables.add("pending_publications")
assert expected_tables == tables
conn.close()