def test_extract_class_general_data(self):

        file = open("test_data/spring2012aas100.xml")

        extract_result = XMLReader.extract_class_general_data(file.read())

        self.assertEqual("2012", extract_result.year)
        self.assertEqual("spring", extract_result.term)
        self.assertEqual("AAS", extract_result.code)
        self.assertEqual("100", extract_result.course_id)
        self.assertEqual("Asian American Studies", extract_result.subject)
        self.assertEqual("Intro Asian American Studies", extract_result.title)
Esempio n. 2
0
 def get_children(self):
     
     classes = []
     for course_id in self.course_ids:
         url_info = URLInfo(self.year, self.term, self.code, course_id, None)
        
         class_data = MyIllinoisXMLRequest.get_data(url_info)
         if class_data == None:
             continue
         
         parsed_class_data = XMLReader.extract_class_general_data(class_data)
         class_general = ClassGeneral(parsed_class_data)
         classes.append(class_general)
         
     return classes