Пример #1
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")
Пример #2
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])
Пример #3
0
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))
Пример #4
0
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)
# equip1 = Equipment("Number 1")
# equip2 = Equipment("Number 2")
# print(equip1)
Пример #5
0
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))