-
Remco Tukker authoredRemco Tukker authored
test_survey_publisher_v1.py 985 B
import os
from compendium_v2 import db
from compendium_v2.db import model
from compendium_v2.publishers.survey_publisher_v1 import _cli
EXCEL_FILE = os.path.join(os.path.dirname(__file__), "data", "2021_Organisation_DataSeries.xlsx")
def test_publisher(client, mocker, dummy_config):
mocker.patch('compendium_v2.background_task.parse_excel_data.EXCEL_FILE', EXCEL_FILE)
with db.session_scope() as session:
nren_names = ['SURF', 'KIFU', 'UoM', 'ASNET-AM', 'SIKT', 'LAT', 'RASH']
session.add_all([model.NREN(name=nren_name) for nren_name in nren_names])
_cli(dummy_config)
with db.session_scope() as session:
budget_count = session.query(model.BudgetEntry.year).count()
assert budget_count
funding_source_count = session.query(model.FundingSource.year).count()
assert funding_source_count
charging_structure_count = session.query(model.ChargingStructure.year).count()
assert charging_structure_count