Exemplo n.º 1
0
 def test_worker_status(self):
     z = Zoo("My Zoo", 500, 3, 3)
     z.hire_worker(Vet("Leo", 35, 100))
     z.hire_worker(Keeper("Tigy", 40, 100))
     z.hire_worker(Caretaker("Chi", 24, 100))
     res = z.workers_status()
     self.assertEqual(
         res,
         "You have 3 workers\n----- 1 Keepers:\nName: Tigy, Age: 40, Salary: 100\n----- 1 Caretakers:\nName: Chi, Age: 24, Salary: 100\n----- 1 Vets:\nName: Leo, Age: 35, Salary: 100"
     )
Exemplo n.º 2
0
    Caretaker("Bill", 21, 68),
    Caretaker("Marie", 32, 105),
    Caretaker("Stacy", 35, 140),
    Vet("Peter", 40, 300),
    Vet("Kasey", 37, 280),
    Vet("Sam", 29, 220)
]

# Adding all animals
for i in range(len(animals)):
    animal = animals[i]
    price = prices[i]
    print(zoo.add_animal(animal, price))

# Adding all workers
for worker in workers:
    print(zoo.hire_worker(worker))

# Tending animals
print(zoo.tend_animals())

# Paying keepers
print(zoo.pay_workers())

# Fireing worker
print(zoo.fire_worker("Adam"))

# # Printing statuses
print(zoo.animals_status())
print(zoo.workers_status())