diff --git a/compendium_v2/conversion/conversion.py b/compendium_v2/conversion/conversion.py index 78ab366469bc199585bfefeaf034fc08756ac824..9c0e9f91dcf86639d8a812680e9d39a078d7be0e 100644 --- a/compendium_v2/conversion/conversion.py +++ b/compendium_v2/conversion/conversion.py @@ -5,6 +5,7 @@ conversion This module loads the survey data from 2022 from the survey database and stores the data in the json structure of the new survey, so that it can be used to prefill the 2023 survey. +It also loads an xlsx file with the data for the services questions. """ import logging diff --git a/test/test_conversion.py b/test/test_conversion.py index eee67c3fb0042b2d2da92d6f3e6c6085966ab8d8..0f48050554fadf9b9df037cee1d5e76dfc809d89 100644 --- a/test/test_conversion.py +++ b/test/test_conversion.py @@ -4,7 +4,7 @@ from sqlalchemy.orm import lazyload from compendium_v2.db import db from compendium_v2.db.model import NREN from compendium_v2.db.survey_model import Survey, SurveyResponse, SurveyStatus -from compendium_v2.conversion.conversion import _cli, convert_answers +from compendium_v2.conversion.conversion import _cli, convert_answers, load_service_data def mock_convert_answers(_): @@ -72,3 +72,19 @@ def test_conversion(): } } } + + +def test_load_service_data(): + service_data_dict = load_service_data() + assert len(service_data_dict.keys()) == 42 + assert len(service_data_dict['ARNES'].keys()) == 8 + assert len(service_data_dict['ARNES']['services_identity']) == 3 + assert len(service_data_dict['SURF'].keys()) == 7 + assert len(service_data_dict['SURF']['services_network']) == 10 + assert service_data_dict['SURF']['services_security']['security-audit'] == { + 'offered': ['yes'], + 'name': 'SURFaudit', + 'additional_information': 'The Standard for Information Security in Higher Education is the basis of ' + 'SURFaudit’s self-assessment.\n\nSURFaudit Security Standard for Higher ' + 'Education is derived from the ISO/IEC 27002:2013 standard' + }