fixes bug that colour checking introduced
This commit is contained in:
parent
a2170e1659
commit
80db96e2fb
|
@ -7,7 +7,7 @@ def make_example_potion(student_name="ASPP student"):
|
|||
"""Make and return an example potion."""
|
||||
my_potion = potion_class.Potion(student_name=student_name)
|
||||
# Set up your old kettle and light an eternal flame underneath it.
|
||||
my_potion.setup(container=containers.OLD_KETTLE, heat_source="eternal_flame")
|
||||
my_potion.setup(container=containers.OLD_KETTLE, heat_source=cooking.ETERNAL_FLAME)
|
||||
# Simmer for 5 hours.
|
||||
cooking.simmer(my_potion, duration=5)
|
||||
print(f"You successfully ran make_example_potion, {student_name}, well done :).")
|
||||
|
@ -24,4 +24,4 @@ if __name__ == "__main__":
|
|||
my_name = 'ASPP student'
|
||||
my_potion = make_example_potion(student_name=my_name)
|
||||
# Let Snape inspect the potion
|
||||
inspection.inspection_by_Snape(potion=my_potion, target_potion='example_potion')
|
||||
inspection.inspection_by_snoope(potion=my_potion, target_potion='example_potion')
|
||||
|
|
|
@ -81,7 +81,7 @@ def inspection_by_snoope(potion, target_potion='python_expert'): # pylint: disa
|
|||
|
||||
# check that potion is cooked
|
||||
if potion.cooked == expected_cooked and potion.simmer_duration == expected_simmer_duration:
|
||||
print('The potion is cooked properly, snoope cannot complain - he is looking annyoyed now.')
|
||||
print('The potion is cooked properly, Snoope cannot complain - he is looking annyoyed now.')
|
||||
else:
|
||||
if potion.simmer_duration < expected_simmer_duration:
|
||||
print('Snoope smirks and remarks "Your potion is undercooked!" \n')
|
||||
|
@ -93,12 +93,12 @@ def inspection_by_snoope(potion, target_potion='python_expert'): # pylint: disa
|
|||
|
||||
print_delay_dots()
|
||||
|
||||
if potion.colour == expected_anticlock_colour:
|
||||
if target_potion == 'python_expert' and potion.colour == expected_anticlock_colour:
|
||||
print("Professor Dimbledore unexpectedly walks through the door, sees your potion and exclaims:")
|
||||
print(f'"Oh my, {potion.student_name}, your potion is absolutely perfect! ')
|
||||
print(' You earn 1000 points and the House Cup for this year\'s ASPP Summer School!"')
|
||||
print('You and your class mates leave to have a butterbeer at the beach in Heraklion!')
|
||||
elif potion.colour == expected_clock_colour:
|
||||
elif target_potion == 'python_expert' and potion.colour == expected_clock_colour:
|
||||
print("Your potion does not only look disgusting, it also smells like rotten eggs. ")
|
||||
print("You vomit into your cauldron and while this does not change the colour, you know you will not pass the class, so you start again. ")
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue