当前位置: 首页>>代码示例>>Python>>正文


Python Scheduler.generateSchedule方法代码示例

本文整理汇总了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 ##
	
开发者ID:nightwolf55la,项目名称:CS206,代码行数:69,代码来源:TestFile.py


注:本文中的Scheduler.Scheduler.generateSchedule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。