Skip to content

Commit

Permalink
[BUG] Fix Dead level 07 test (hedyorg#3766)
Browse files Browse the repository at this point in the history
Fixes hedyorg#3669
The _test_if_pressed_repeat_ test has been modified in level 7.
  • Loading branch information
ToniSkulj authored Dec 3, 2022
1 parent c6721cb commit 298fe2c
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions tests/test_level/test_level_07.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,20 @@ def test_repeat_if(self):
code=code,
expected=expected)

# def test_if_pressed_repeat(self):
# code = "if x is pressed repeat 5 times print 'doe het 5 keer!'"

# expected = HedyTester.dedent("""\
# if event.key == pygame.K_x:
# for i in range(int('5')):
# print(f'doe het 5 keer!')
# time.sleep(0.1)""")
def test_if_pressed_repeat(self):
code = "if x is pressed repeat 5 times print 'doe het 5 keer!'"

expected = HedyTester.dedent("""\
while not pygame_end:
pygame.display.update()
event = pygame.event.wait()
if event.type == pygame.QUIT:
pygame_end = True
pygame.quit()
break
if event.type == pygame.KEYDOWN:
if event.unicode == 'x':
for i in range(int('5')):
print(f'do it 5 times!')
time.sleep(0.1)
break""")

0 comments on commit 298fe2c

Please sign in to comment.