sprite = codesters.Sprite("knight1", -175, -150)
sprite.set_speed(2)
t = codesters.Teacher()
try:
func = t.find_text('def park')
tval1 = func[0][1]
except:
func = "DNE"
tval1 = "DNE"
try:
setting = t.find_text('stage')
line = setting[0][0]
tval2 = t.get_indent_at_line(line)
tval3 = setting[0][1]
except:
setting = "DNE"
line = "DNE"
tval2 = "DNE"
tval3 = "DNE"
t1 = TestObjective()
t1.add_success('def park_scene():' in tval1, "Great job!")
t1.add_failure('park_scene' not in tval1, "Did you create a function and name it park_scene?")
t2 = TestObjective()
t2.add_success(tval2 == 4 and 'park' in tval3, "Great job!")
t2.add_failure('stage' not in tval3, "Did you put a stage backgound in your function?")
t2.add_failure(tval2 < 4, "Did you indent your background in your function?")
t2.add_failure(tval2 > 4, "It looks like you indented the background too far. It should be nested 4 spaces inside your function.")
t2.add_failure('park' not in tval3, "It looks like you chose a different background image, try choosing a background to match your function name.")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()