Example #1
0
def get_selected_course():
    sno = request.cookies.get('sno')
    cookie = request.cookies.get('JSESSIONID')
    year, term , course_type, campus = [request.args[x] for x in ['year', 'term', 'course_type', 'campus']]
    _, result = sysujwxt.get_available_courses(cookie.encode('ascii'),
                                               year.encode('ascii'),
                                               term.encode('ascii'),
                                               course_type.encode('ascii'),
                                               campus.encode('ascii'))
    return result
Example #2
0
def get_selected_course():
    sno = request.cookies.get('sno')
    cookie = request.cookies.get('JSESSIONID')
    year, term, course_type, campus = [
        request.args[x] for x in ['year', 'term', 'course_type', 'campus']
    ]
    _, result = sysujwxt.get_available_courses(cookie.encode('ascii'),
                                               year.encode('ascii'),
                                               term.encode('ascii'),
                                               course_type.encode('ascii'),
                                               campus.encode('ascii'))
    return result
Example #3
0
 def test_expired_queries(self):
     success, result = fakesysujwxt.get_score(self.cookie[::-1], self.sno, self.year, self.term)
     self.assertEqual(result, 'expired')
     success, result = fakesysujwxt.get_timetable(self.cookie[::-1], self.year, self.term)
     self.assertEqual(result, 'expired')
     success, result = fakesysujwxt.get_available_courses(self.cookie[::-1], self.year, self.term, '30', '1')
     self.assertEqual(result, 'expired')
     success, result = fakesysujwxt.get_course_result(self.cookie[::-1], self.year, self.term)
     self.assertEqual(result, 'expired')
     success, result = fakesysujwxt.get_earned_credit(self.cookie[::-1], self.sno, self.year, self.term)
     self.assertEqual(result, 'expired')
     success, result = fakesysujwxt.get_gpa(self.cookie[::-1], self.sno, self.year, self.term)
     self.assertEqual(result, 'expired')
Example #4
0
 def test_get_available_courses(self):
     success, result = fakesysujwxt.get_available_courses(self.cookie, self.year, self.term, '30', '1')
     self.assertTrue(success)