コード例 #1
0
 def test_request_data(self):
     
     working_url = 'http://courses.illinois.edu/cisapp/explorer/schedule/2012/spring/AAS.xml'
     
     correct_data = open('test_data/spring2012aas.xml').read()
     results = MyIllinoisXMLRequest.get_data(working_url)
     
     self.assertEquals(results, correct_data)
コード例 #2
0
ファイル: XMLReader.py プロジェクト: timm3/classTable
 def request_data(year, term, code, course_id, crn):
     
     URLInfo = namedtuple('URLInfo', 'year term code course_id crn')
     
     url_info = URLInfo(year, term, code, course_id, crn)
     
     xml_data = MyIllinoisXMLRequest.get_data(url_info)
     if xml_data == None:
         return None
     
     return xml_data
コード例 #3
0
ファイル: Subject.py プロジェクト: timm3/classTable
 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
コード例 #4
0
ファイル: CalendarYear.py プロジェクト: timm3/classTable
 def get_children(self):
     
     terms = []
     url_info = URLInfo(self.year, None, None, None, None)
     
     term_data = MyIllinoisXMLRequest.get_data(url_info)
     if term_data == None:
         return None
     
     parsed_term_data = XMLReader.extract_terms_data(term_data)
     if parsed_term_data != None:
         for t in parsed_term_data:
             term = Term(t)
             terms.append(term)
     
     return terms
コード例 #5
0
ファイル: Term.py プロジェクト: uiuc-cs428-urs/classTable
    def get_children(self):

        subjects = []

        url_info = URLInfo(self.year, self.term, None, None, None)
        subject_data = MyIllinoisXMLRequest.get_data(url_info)

        if subject_data == None:
            return None

        parsed_subject_data = XMLReader.extract_subjects_data(subject_data)

        for s in parsed_subject_data:
            subject = Subject(s)
            subjects.append(subject)

        return subjects
コード例 #6
0
    def get_children(self):

        URLInfo = namedtuple("URLInfo", "year term code course_id crn")
        sections = []

        for crn in self.crns:
            url_info = URLInfo(self.year, self.term, self.code, self.course_id, crn)

            section_data = MyIllinoisXMLRequest.get_data(url_info)
            if section_data == None:
                continue

            parsed_section_data = XMLReader.extract_section_data(section_data)
            class_section = ClassSection(parsed_section_data)

            sections.append(class_section)

        return sections
コード例 #7
0
    def test_build_url(self):
        
        url_info = URLInfo('2013', 'spring', 'AAS', None, None)
        url = MyIllinoisXMLRequest.build_url(url_info)

        self.assertEqual('http://courses.illinois.edu/cisapp/explorer/schedule/2013/spring/AAS.xml', url)