Skip to content
Snippets Groups Projects
Commit 6e8812aa authored by Remco Tukker's avatar Remco Tukker
Browse files

add testcase

parent 45aeb408
No related branches found
No related tags found
1 merge request!66Conversion of services data
......@@ -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
......
......@@ -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'
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment