Skip to content

Commit

Permalink
monpop
Browse files Browse the repository at this point in the history
  • Loading branch information
stgm committed Oct 17, 2022
1 parent 15c6430 commit 59ca7b0
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/monopoly/monopoly_realistischTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,21 @@ def hassimuleer_groot_aantal_potjes_Monopoly(test):
file_contents = f.readlines()

with open(tempfile, 'w') as f:
in_def = False
after_def = False
state = 0
for line in file_contents:
if line.startswith('import') or line.strip() == '':
f.write(line)
elif not in_def:
if state == 0:
if line.startswith('def '):
in_def = True
state = 1
f.write(line)
elif not (line.startswith(' ') or line.startswith("\t") or line.startswith("def ") or line.startswith("#")):
break
else:
elif state == 1:
if not (line.strip() == '' or line.startswith(' ') or line.startswith("\t") or line.startswith("def ") or line.startswith("#")):
state = 2
continue
f.write(line)
elif state == 2:
if line.startswith('def '):
f.write(line)
state = 1

_fileName = tempfile

Expand Down

0 comments on commit 59ca7b0

Please sign in to comment.