Initial build out
This commit is contained in:
parent
f037c50736
commit
29215e2bd2
40 changed files with 2622 additions and 0 deletions
22
tests/test_db_schema.py
Normal file
22
tests/test_db_schema.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
def test_tables_created(db_conn):
|
||||
tables = db_conn.execute(
|
||||
"SELECT table_name FROM information_schema.tables WHERE table_schema = 'main'"
|
||||
).fetchall()
|
||||
table_names = {t[0] for t in tables}
|
||||
expected = {
|
||||
"raw_institution",
|
||||
"raw_ipeds_finance",
|
||||
"raw_ipeds_staff",
|
||||
"raw_ipeds_enrollment",
|
||||
"raw_990_filing",
|
||||
"raw_990_schedule_j",
|
||||
"raw_990_part_vii",
|
||||
"raw_cpi_u",
|
||||
}
|
||||
assert expected.issubset(table_names)
|
||||
|
||||
|
||||
def test_schema_idempotent(db_conn):
|
||||
"""Calling ensure_schema twice should not raise."""
|
||||
from admin_analytics.db.schema import ensure_schema
|
||||
ensure_schema(db_conn) # already called in fixture; second call should be fine
|
||||
Loading…
Add table
Add a link
Reference in a new issue