class MyTestCase(unittest.TestCase):

	def setUp(self):
		self.schedule = Schedule(mid=1)


	def test_func(self):
		res = self.schedule.get_available_times()
		assert(len(res) != 0)

		
	def tearDown(self):
		self.schedule.db_close()
Exemplo n.º 2
0
	def get_machine_schedule_dictionaries(self):
		mg = Machine("temp")
		machines = mg.get_all_machines()
		types = {"Treadmill":{},"Strider":{},"Ski":{}}
		for machine in machines:
			mid = machine[0]
			#print(mid)
			mtype = machine[2]
			#print(mtype)
			schedule = Schedule()
			times = schedule.get_available_times(mid)
			#print(times)
			if mtype == "Treadmill":
				types["Treadmill"][mid] = times
			if mtype == "Strider":
				types["Strider"][mid] = times
			if mtype == "Ski":
				types["Ski"][mid] = times
			schedule.db_close()
		mg.db_close()
		return types