Esempio n. 1
0
 def test_plan_from_hours(self):
     ExercisePlan.id = 1
     p = ExercisePlan.from_hours(1, 1, 16)
     self.assertEqual(p.id, 1)
     self.assertEqual(p.trainer_id, 1)
     self.assertEqual(p.equipment_id, 1)
     self.assertEqual(p.duration, 960)
Esempio n. 2
0
 def test_plan_init(self):
     ExercisePlan.id = 1
     p = ExercisePlan(1, 1, 10)
     self.assertEqual(p.id, 1)
     self.assertEqual(p.trainer_id, 1)
     self.assertEqual(p.equipment_id, 1)
     self.assertEqual(p.duration, 10)
Esempio n. 3
0
 def test_gym_subscription_info(self):
     Gym.id = 1
     Subscription.id = 1
     ExercisePlan.id = 1
     Equipment.id = 1
     Trainer.id = 1
     Customer.id = 1
     g = Gym()
     s = Subscription("10.02.2020", 1, 1, 1)
     p = ExercisePlan(1, 1, 10)
     e = Equipment("Pesho")
     t = Trainer("Pesho")
     c = Customer("Pesho", "addr.", "*****@*****.**")
     g.add_subscription(s)
     g.add_customer(c)
     g.add_equipment(e)
     g.add_plan(p)
     g.add_trainer(t)
     self.assertEqual(
         g.subscription_info(1),
         "Subscription <1> on 10.02.2020\nCustomer <1> Pesho; Address: addr.; Email: [email protected]\nTrainer <1> Pesho\nEquipment <1> Pesho\nPlan <1> with duration 10 minutes"
     )
Esempio n. 4
0
 def test_plan_repr(self):
     ExercisePlan.id = 1
     p = ExercisePlan(1, 1, 15)
     self.assertEqual(str(p), "Plan <1> with duration 15 minutes")
Esempio n. 5
0
 def test_plan_static_method(self):
     ExercisePlan.id = 1
     self.assertEqual(ExercisePlan.get_next_id(), 1)
Esempio n. 6
0
 def test_gym_add_plan(self):
     g = Gym()
     p = ExercisePlan(1, 1, 10)
     g.add_plan(p)
     g.add_plan(p)
     self.assertEqual(g.plans, [p])