feat: unify network and topology table column filters

Replace top filter bars with shared Excel-style column menus, fix select-all and modal interactions, and use plain dropdown indicators. Apply exact-value filters before pagination and export. Isolate pytest database state and cover filter behavior.
This commit is contained in:
oliver 2026-10-12 23:36:00 +08:00
parent ed820126df
commit 3c9e0efd2b
32 changed files with 1429 additions and 645 deletions

View file

@ -1,7 +1,33 @@
"""Shared test hygiene."""
"""Shared test hygiene: never connect the test suite to the application database."""
import os
from pathlib import Path
from tempfile import TemporaryDirectory
import pytest
# Set this before any test imports netx_api.config/db. Several older unittest
# cases use the global SessionLocal and delete entire tables in setUp.
_TEST_STATE = TemporaryDirectory(prefix="netx-tests-", ignore_cleanup_errors=True)
_TEST_DATABASE_URL = f"sqlite:///{(Path(_TEST_STATE.name) / 'netx.sqlite').as_posix()}"
os.environ["NETX_DATABASE_URL"] = _TEST_DATABASE_URL
os.environ["NETX_CREDENTIAL_SECRET_FILE"] = str(Path(_TEST_STATE.name) / "credential_secret")
def pytest_sessionstart(session):
from netx_api.db import engine
if str(engine.url) != _TEST_DATABASE_URL:
raise pytest.UsageError("NetX tests require the isolated temporary database")
def pytest_sessionfinish(session, exitstatus):
from netx_api.db import engine
engine.dispose()
_TEST_STATE.cleanup()
@pytest.fixture(autouse=True)
def _fresh_baseline_row_cache():
"""Test databases reuse batch ids; the process-wide baseline cache must not leak between tests."""