本文整理汇总了Python中Scheduler.Scheduler.generateSchedule方法的典型用法代码示例。如果您正苦于以下问题:Python Scheduler.generateSchedule方法的具体用法?Python Scheduler.generateSchedule怎么用?Python Scheduler.generateSchedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scheduler.Scheduler
的用法示例。
在下文中一共展示了Scheduler.generateSchedule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Scheduler import Scheduler [as 别名]
# 或者: from Scheduler.Scheduler import generateSchedule [as 别名]
#.........这里部分代码省略.........
print "getCourse() actual: ",found.major,found.ID
assert False, "test 7 failed: getCourse error"
''' Test #7
Desc: Tests to see if function populates the self.allCourses list with all of the Courses a student could take
Class: Scheduler Method: populateCourseData(self)
Input: valid course file'''
def test7(self):
self.initScheduler()
dummyCourse = self.genDummyCourse()
oldAllCourses = Scheduler.allCourses
found = False
try:
self.sc.populateCourseData()
except:
assert False, "test 8 failed: exception"
finally:
for course in self.sc.allCourses:
if course.ID == dummyCourse.ID and course.major == dummyCourse.major:
found = True
Scheduler.allCourses = oldAllCourses
assert found, "test 8 failed: popCourseData error"
''' Test #8
Desc: Tests to see if function has converted all classes prereqs from the form [(major, ID), (major, ID),...] to [classRef1, classRef2, ...]
Class: Scheduler Method: generatePrequisites(self)
Input: valid course list'''
##This function is covered by the integration test: verifyPrerequisitesIntegrationTest
''' Test #9
Desc: Tests to see if function generates a complete semester-by-semester generated schedule for earliest graduation time for the specified major and student
Class: Scheduler Method: generateSchedule(self)
Input: valid course, major, and student'''
def test9(self):
self.initScheduler()
try:
self.sc.populateCourseData()
Scheduler.student = Student("patrick.txt")
Scheduler.major = Major(Scheduler.MAJOR_FILES[1])
self.sc.generateSchedule()
except Exception as e:
print "Exception: " + str(e)
return False
return True
''' Test #10
Desc: Tests to see if function prints a complete semester-by-semester generated schedule for earliest graduation time for the specified major and student
Class: Scheduler Method: printSchedule(self)
Input: valid schedule'''
def test10(self):
self.initScheduler()
try:
self.sc.populateCourseData()
Scheduler.student = Student("abira.txt")
Scheduler.major = Major(Scheduler.MAJOR_FILES[1])
self.sc.generateSchedule()
self.sc.printSchedule()
except Exception as e:
print "Exception: " + str(e)
return False
return True
## VALIDATION TESTS ##