generated from coulomb/repo-seed
28 lines
683 B
Python
28 lines
683 B
Python
from sqlalchemy import inspect
|
|
|
|
import core_hub.models # noqa: F401
|
|
from core_hub.db import Base
|
|
|
|
FOUNDATION_TABLES = {
|
|
"hubs",
|
|
"hub_capability_manifests",
|
|
"api_consumers",
|
|
"api_keys",
|
|
"widgets",
|
|
"interaction_events",
|
|
"migration_runs",
|
|
}
|
|
|
|
|
|
def test_metadata_contains_foundation_tables():
|
|
assert FOUNDATION_TABLES.issubset(Base.metadata.tables)
|
|
|
|
|
|
async def test_sqlite_fixture_creates_foundation_tables(sqlite_engine):
|
|
async with sqlite_engine.connect() as connection:
|
|
table_names = await connection.run_sync(
|
|
lambda sync_conn: inspect(sync_conn).get_table_names()
|
|
)
|
|
|
|
assert FOUNDATION_TABLES.issubset(table_names)
|