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")
from project.pokemon import Pokemon from project.trainer import Trainer pokemon = Pokemon("Pikachu", 90) print(pokemon.pokemon_details()) trainer = Trainer("Ash") print(trainer.add_pokemon(pokemon)) second_pokemon = Pokemon("Charizard", 110) print(trainer.add_pokemon(second_pokemon)) print(trainer.add_pokemon(second_pokemon)) print(trainer.release_pokemon("Pikachu")) print(trainer.release_pokemon("Pikachu")) print(trainer.trainer_data())
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")
from project.customer import Customer from project.equipment import Equipment from project.exercise_plan import ExercisePlan from project.gym import Gym from project.subscription import Subscription from project.trainer import Trainer customer = Customer("John", "Maple Street", "*****@*****.**") equipment = Equipment("Treadmill") trainer = Trainer("Peter") subscription = Subscription("14.05.2020", 1, 1, 1) plan = ExercisePlan(1, 1, 20) gym = Gym() gym.add_customer(customer) gym.add_equipment(equipment) gym.add_trainer(trainer) gym.add_plan(plan) gym.add_subscription(subscription) print(Customer.get_next_id()) print(gym.subscription_info(1)) # c = Customer("Sofia", "Lozen", "*****@*****.**") # print(c) # # m = Customer("Sofia", "Lozen", "*****@*****.**") # print(c) # print(m)
from project.customer import Customer from project.equipment import Equipment from project.exercise_plan import ExercisePlan from project.gym import Gym from project.subscription import Subscription from project.trainer import Trainer customer1 = Customer("John", "Maple Street", "*****@*****.**") equipment1 = Equipment("Treadmill") trainer1 = Trainer("Peter") subscription1 = Subscription("14.05.2020", 1, 1, 1) plan1 = ExercisePlan(1, 1, 20) gym = Gym() gym.add_customer(customer1) gym.add_equipment(equipment1) gym.add_trainer(trainer1) gym.add_plan(plan1) gym.add_subscription(subscription1) print(Customer.get_next_id()) # print(Customer.get_next_id()) # print(Customer.get_next_id()) print(gym.subscription_info(1))
from project.customer import Customer from project.equipment import Equipment from project.exercise_plan import ExercisePlan from project.gym import Gym from project.subscription import Subscription from project.trainer import Trainer customer = Customer("John", "Maple Street", "*****@*****.**") customer2 = Customer("Atanas", "test", "*****@*****.**") equipment = Equipment("Treadmill") equipment2 = Equipment("Push Ups") trainer = Trainer("Peter") trainer2 = Trainer("Gosho") subscription = Subscription("14.05.2020", 1, 1, 1) subscription2 = Subscription("05.11.2020", 2, 2, 2) plan = ExercisePlan(1, 1, 20) plan2 = ExercisePlan.from_hour(2, 2, 3) gym = Gym() gym.add_customer(customer2) gym.add_equipment(equipment2) gym.add_trainer(trainer2) gym.add_plan(plan2) gym.add_subscription(subscription2) # print(Customer.get_next_id()) # # print(gym.subscription_info(1)) print(gym.subscription_info(2))