Initial build out
This commit is contained in:
parent
f037c50736
commit
29215e2bd2
40 changed files with 2622 additions and 0 deletions
25
tests/test_ipeds_finance.py
Normal file
25
tests/test_ipeds_finance.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import shutil
|
||||
|
||||
import admin_analytics.config as config
|
||||
from admin_analytics.config import UD_UNITID
|
||||
from admin_analytics.ipeds.finance import load_finance
|
||||
|
||||
|
||||
def test_load_finance_filters_to_ud(db_conn, fixtures_dir, tmp_path):
|
||||
ipeds_dir = tmp_path / "ipeds" / "finance" / "2023"
|
||||
ipeds_dir.mkdir(parents=True)
|
||||
shutil.copy(fixtures_dir / "f1a2023.csv", ipeds_dir / "f1a2023.csv")
|
||||
|
||||
original = config.IPEDS_DATA_DIR
|
||||
config.IPEDS_DATA_DIR = tmp_path / "ipeds"
|
||||
try:
|
||||
count = load_finance(db_conn, range(2023, 2024), unitid_filter=UD_UNITID)
|
||||
finally:
|
||||
config.IPEDS_DATA_DIR = original
|
||||
|
||||
assert count == 1
|
||||
row = db_conn.execute(
|
||||
"SELECT institutional_support_expenses FROM raw_ipeds_finance WHERE unitid = ?",
|
||||
[UD_UNITID],
|
||||
).fetchone()
|
||||
assert row[0] == 150000000
|
||||
Loading…
Add table
Add a link
Reference in a new issue