Skip to content

Commit d22f267

Browse files
committed
ww
1 parent 1d20701 commit d22f267

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/wachtwoordTest.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66

77
@t.passed(doctest_ok)
88
@t.test(9)
9-
def check_any(test):
10-
def testMethod():
11-
source_no_comments = lib.removeComments(lib.source(test.fileName))
12-
return "any(" not in source_no_comments and "any (" not in source_no_comments
13-
test.test = testMethod
14-
test.description = lambda : "geen gebruik van de functie any()"
9+
def check_code(test):
10+
"""geen loops gebruikt in deze opdracht"""
11+
assert not_in_code(ast.While)
12+
assert not_in_code(ast.For)
1513

16-
@t.passed(check_any)
14+
@t.passed(check_code)
1715
@t.test(10)
1816
def checks_length(test):
1917
"""functie `check_length` werkt correct"""
@@ -25,7 +23,7 @@ def testMethod():
2523
return False
2624
test.test = testMethod
2725

28-
@t.passed(check_any)
26+
@t.passed(check_code)
2927
@t.test(20)
3028
def checks_letter(test):
3129
"""functie `check_letter` werkt correct"""
@@ -37,7 +35,7 @@ def testMethod():
3735
return False
3836
test.test = testMethod
3937

40-
@t.passed(check_any)
38+
@t.passed(check_code)
4139
@t.test(30)
4240
def checks_number(test):
4341
"""functie `check_number` werkt correct"""
@@ -49,7 +47,7 @@ def testMethod():
4947
return False
5048
test.test = testMethod
5149

52-
@t.passed(check_any)
50+
@t.passed(check_code)
5351
@t.test(40)
5452
def checks_password(test):
5553
"""functie `check_password` werkt correct"""

0 commit comments

Comments
 (0)