Skip to content

Commit c989cc9

Browse files
Merge pull request #84 from UmiKami/04-Multiply-Two-Values
added test to prevent student from hardcoding result
2 parents 4267215 + 06601c8 commit c989cc9

File tree

1 file changed

+7
-0
lines changed
  • exercises/04-Multiply-Two-Values

1 file changed

+7
-0
lines changed

exercises/04-Multiply-Two-Values/test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,10 @@ def test_for_print():
3232
# makes sure we are calling print function with a variable and not the hard coded value
3333
regex = re.compile(r"print\s*\(\s*variables_are_cool\s*\)")
3434
assert bool(regex.search(content)) == True
35+
36+
@pytest.mark.it('You should not hardcode the result')
37+
def test_for_print():
38+
with open(path, 'r') as content_file:
39+
content = content_file.read()
40+
# makes sure we are calling print function with a variable and not the hard coded value
41+
assert str(17172435) not in content

0 commit comments

Comments
 (0)