Created
July 25, 2014 12:40
-
-
Save OrangeTux/f8c41a12f07b1c04afc7 to your computer and use it in GitHub Desktop.
Some pseude test code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# my_app.py | |
from math import power | |
def some_fun(i): | |
if power(i) > 10: | |
return True | |
return False | |
# test_my_app.py | |
from my_app import some_func | |
from math import power | |
def mock_power(i): | |
# Real implemention of power is very, very complex. | |
# But I don't care how it works. When I insert some | |
# value in my test I expect that it returns 5. And I | |
# want to test how my software handles this response. | |
return 5 | |
power = mock_power | |
test_my_func(): | |
assert test_my_func(5) is False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment