Skip to content

Instantly share code, notes, and snippets.

@bramses
Created July 6, 2018 21:25
Show Gist options
  • Save bramses/7c2244c6f5988b8de2b80941b9a4e549 to your computer and use it in GitHub Desktop.
Save bramses/7c2244c6f5988b8de2b80941b9a4e549 to your computer and use it in GitHub Desktop.
How To test Without Really Trying
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