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" )
def test_gym_add_trainer(self): g = Gym() t = Trainer("Pesho") g.add_trainer(t) g.add_trainer(t) self.assertEqual(g.trainers, [t])
def test_trainer_repr(self): Trainer.id = 1 t = Trainer("Pesho") self.assertEqual(str(t), "Trainer <1> Pesho")
def test_trainer_init(self): Trainer.id = 1 t = Trainer("Pesho") self.assertEqual(t.id, 1) self.assertEqual(t.name, "Pesho")
def test_trainer_static_method(self): Trainer.id = 1 self.assertEqual(Trainer.get_next_id(), 1)