feat: add governed public knowledge retrieval
This commit is contained in:
@@ -9,6 +9,7 @@ from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
import app.model.fund as fund_models
|
||||
from app.model.base import Base
|
||||
|
||||
REPOSITORY_PATH = "app/repository/fund_query_repository.py"
|
||||
@@ -123,10 +124,11 @@ def test_fund_model_module_contains_only_column_mappings() -> None:
|
||||
|
||||
|
||||
def test_fund_models_cover_all_fin_tables_with_expected_columns() -> None:
|
||||
assert fund_models
|
||||
tables: dict[str, Any] = {
|
||||
name: table
|
||||
for name, table in Base.metadata.tables.items()
|
||||
if name.startswith("fin_")
|
||||
if name in FUND_TABLES
|
||||
}
|
||||
assert set(tables) == set(FUND_TABLES)
|
||||
for name, (column_count, primary_key) in FUND_TABLES.items():
|
||||
@@ -137,7 +139,7 @@ def test_fund_models_cover_all_fin_tables_with_expected_columns() -> None:
|
||||
|
||||
def test_fund_models_declare_no_foreign_keys_so_no_cascade_writes() -> None:
|
||||
for name, table in Base.metadata.tables.items():
|
||||
if not name.startswith("fin_"):
|
||||
if name not in FUND_TABLES:
|
||||
continue
|
||||
for column in table.columns:
|
||||
assert not column.foreign_keys, f"{name}.{column.name}"
|
||||
|
||||
Reference in New Issue
Block a user