Skip to content

Commit 6e2dadc

Browse files
committed
more error message
1 parent 684a328 commit 6e2dadc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/colaTest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,21 @@ def testMethod():
1414
return False
1515

1616
test.test = testMethod
17-
test.description = lambda : "'check_coin' works correctly."
17+
test.description = lambda : "'check_coin' works correctly"
1818

1919
@t.test(1)
2020
def checks_due(test):
2121
def testMethod():
2222
due = lib.getFunction("determine_due", test.fileName)
23+
if due(50, 20) == 30:
24+
return False, "function accepts a coin of 20, but this coin should not exist"
2325
if due(50, 25) == 25 and due(50, 20) == 50 and due(50, 10) == 40:
2426
return True
2527
else:
2628
return False
2729

2830
test.test = testMethod
29-
test.description = lambda : "'determine_due' works correctly."
31+
test.description = lambda : "'determine_due' works correctly"
3032

3133
@t.test(2)
3234
def checks_main(test):
@@ -37,4 +39,4 @@ def testMethod():
3739
return asserts.exact(output.strip()[-2:], answer)
3840

3941
test.test = testMethod
40-
test.description = lambda : "The change (10) is correctly calculated after inserting 25, 10, en 25 cents."
42+
test.description = lambda : "the change (10) is correctly calculated after inserting 25, 10, and 25 cents"

0 commit comments

Comments
 (0)