Beispiel #1
0
 def test_build_multi_degree_mapping(self):
     mapping_data = [{
         'email': '*****@*****.**',
         'degree': 'B.S.',
         'major': 'Computer Science',
         'college': 'Whiting School of Engineering'
     }, {
         'email': '*****@*****.**',
         'degree': 'B.S.',
         'major': 'Mech Eng',
         'college': 'Whiting School of Engineering'
     }, {
         'email': '*****@*****.**',
         'degree': 'B.A.',
         'major': 'English',
         'college': 'Krieger School of Arts and Sciences'
     }]
     expected = ValueMap()
     expected.add_mapping('*****@*****.**', [
         JHUDegree(degree='B.S.',
                   major='Computer Science',
                   college='Whiting School of Engineering'),
         JHUDegree(degree='B.S.',
                   major='Mech Eng',
                   college='Whiting School of Engineering'),
         JHUDegree(degree='B.A.',
                   major='English',
                   college='Krieger School of Arts and Sciences')
     ])
     self.assertEqual(expected,
                      ValueMapBuilder.build_jhu_degree_map(mapping_data))
Beispiel #2
0
 def test_build_multi_student_mapping(self):
     mapping_data = [{
         'email': '*****@*****.**',
         'degree': 'B.A.',
         'major': 'Mathematics',
         'college': 'Krieger School of Arts and Sciences'
     }, {
         'email': '*****@*****.**',
         'degree': 'B.S.',
         'major': 'Mech Eng',
         'college': 'Whiting School of Engineering'
     }, {
         'email': '*****@*****.**',
         'degree': 'B.A.',
         'major': 'English',
         'college': 'Krieger School of Arts and Sciences'
     }, {
         'email': '*****@*****.**',
         'degree': 'B.S.',
         'major': 'Electrical Engineering',
         'college': 'Whiting School of Engineering'
     }, {
         'email': '*****@*****.**',
         'degree': 'B.A.',
         'major': 'Writing Seminars',
         'college': 'Krieger School of Arts and Sciences'
     }]
     expected = ValueMap()
     expected.add_mapping('*****@*****.**', [
         JHUDegree(degree='B.A.',
                   major='Mathematics',
                   college='Krieger School of Arts and Sciences')
     ])
     expected.add_mapping('*****@*****.**', [
         JHUDegree(degree='B.S.',
                   major='Mech Eng',
                   college='Whiting School of Engineering'),
         JHUDegree(degree='B.A.',
                   major='English',
                   college='Krieger School of Arts and Sciences')
     ])
     expected.add_mapping('*****@*****.**', [
         JHUDegree(degree='B.S.',
                   major='Electrical Engineering',
                   college='Whiting School of Engineering'),
         JHUDegree(degree='B.A.',
                   major='Writing Seminars',
                   college='Krieger School of Arts and Sciences')
     ])
     self.assertEqual(expected,
                      ValueMapBuilder.build_jhu_degree_map(mapping_data))
Beispiel #3
0
 def test_build_empty_map(self):
     self.assertEqual(ValueMap(), ValueMapBuilder.build_jhu_degree_map([]))
Beispiel #4
0
 def _load_jhu_degree_map(self):
     raw_data = csv_to_list_of_dicts(self._mapping_filepaths['jhu_degree'])
     self.jhu_degree_map = ValueMapBuilder.build_jhu_degree_map(raw_data)