Skip to content

Commit

Permalink
more error message
Browse files Browse the repository at this point in the history
  • Loading branch information
stgm committed Oct 5, 2022
1 parent 684a328 commit 6e2dadc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/colaTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ def testMethod():
return False

test.test = testMethod
test.description = lambda : "'check_coin' works correctly."
test.description = lambda : "'check_coin' works correctly"

@t.test(1)
def checks_due(test):
def testMethod():
due = lib.getFunction("determine_due", test.fileName)
if due(50, 20) == 30:
return False, "function accepts a coin of 20, but this coin should not exist"
if due(50, 25) == 25 and due(50, 20) == 50 and due(50, 10) == 40:
return True
else:
return False

test.test = testMethod
test.description = lambda : "'determine_due' works correctly."
test.description = lambda : "'determine_due' works correctly"

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

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

0 comments on commit 6e2dadc

Please sign in to comment.