Created
July 6, 2018 21:25
-
-
Save bramses/7c2244c6f5988b8de2b80941b9a4e549 to your computer and use it in GitHub Desktop.
How To test Without Really Trying
This file contains 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
def hard_state_add_5(whole_obj): | |
if "a" in whole_obj: | |
return whole_obj["a"] + 5 | |
def easy_state_add_5(input_num): | |
return input_num + 5 | |
def main(): | |
whole_obj = {} | |
whole_obj["a"] = 10 | |
val1 = hard_state_add_5(whole_obj) | |
val2 = easy_state_add_5(whole_obj["a"]) | |
print(val1) # 15 | |
print(val2) # 15 | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment