class MyTestCase(unittest.TestCase):
    def setUp(self):
        self.schedule = Schedule(mid=1)

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

    def tearDown(self):
        self.schedule.db_close()
class MyTestCase(unittest.TestCase):
    def setUp(self):
        self.schedule = Schedule()

    def test_func(self):
        res = self.schedule.get_user_schedule(2)
        print(res)
        #self.assertEqual(res, ["08:00 - 08:30","08:30 - 09:00","09:00 - 09:30","10:00 - 10:00","10:30 - 11:00","11:00 - 11:30","11:30 - 12:00","12:30 - 13:00","13:00 - 13:30","13:30 - 14:00","14:00 - 14:30","14:30 - 15:00","15:00 - 15:30","15:30 - 16:00","16:00 - 16:30","16:30 - 17:00"])

    def tearDown(self):
        self.schedule.db_close()
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()
Exemple #4
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