def test_includes_midterm_grades(self, app, student_tables): terms_feed, canvas_site_feed = generate_student_term_maps( self.advisees_by_sid) term_feed = terms_feed['2178'][self.oski_sid] assert '2178' == term_feed['termId'] enrollments = term_feed['enrollments'] assert 4 == len(enrollments) assert 'D-' == enrollments[0]['midtermGrade'] assert 'BURMESE 1A' == enrollments[0]['displayName'] assert 90100 == enrollments[0]['sections'][0]['ccn']
def test_includes_instruction_modes(self, app, student_tables): terms_feed, canvas_site_feed = generate_student_term_maps( self.advisees_by_sid) term_feed = terms_feed['2178'][self.oski_sid] assert term_feed['enrollments'] for enrollment in term_feed['enrollments']: assert enrollment['sections'] for section in enrollment['sections']: if section['ccn'] == 90200: assert 'H' == section['instructionMode'] elif section['ccn'] == 90399: assert 'W' == section['instructionMode'] else: assert 'P' == section['instructionMode']
def test_includes_course_site_section_mappings(self, app): """Maps Canvas sites to SIS courses and sections.""" terms_feed, canvas_site_feed = generate_student_term_maps( self.advisees_by_sid) term_feed = terms_feed['2178'][self.oski_sid] enrollments = term_feed['enrollments'] assert len(enrollments[0]['canvasSites']) == 1 assert enrollments[0]['canvasSites'][0]['canvasCourseId'] == 7654320 assert enrollments[0]['sections'][0]['canvasCourseIds'] == [7654320] assert len(enrollments[1]['canvasSites']) == 2 assert enrollments[1]['canvasSites'][0]['canvasCourseId'] == 7654321 assert enrollments[1]['canvasSites'][1]['canvasCourseId'] == 7654330 assert enrollments[1]['sections'][0]['canvasCourseIds'] == [ 7654321, 7654330 ] assert len(enrollments[2]['canvasSites']) == 2 assert enrollments[2]['canvasSites'][0]['canvasCourseId'] == 7654323 assert enrollments[2]['canvasSites'][1]['canvasCourseId'] == 7654330 assert (enrollments[2]['sections'][0]['canvasCourseIds']) == [ 7654323, 7654330 ] assert (enrollments[2]['sections'][1]['canvasCourseIds']) == [7654330]
def test_merges_drops(self, app, student_tables): terms_feed, canvas_site_feed = generate_student_term_maps( self.advisees_by_sid) drops = terms_feed['2178'][self.oski_sid]['droppedSections'] assert 2 == len(drops) assert drops[0] == { 'component': 'STD', 'displayName': 'ENV,RES C9', 'instructionMode': 'P', 'sectionNumber': '001', 'withdrawAfterDeadline': True, } assert drops[1] == { 'component': 'LEC', 'displayName': 'HISTORY 10CH', 'instructionMode': 'P', 'sectionNumber': '003', 'withdrawAfterDeadline': False, } enrollments = terms_feed['2178'][self.oski_sid]['enrollments'] assert any(enr['displayName'] == 'ENV,RES C9' for enr in enrollments) is False