Guest User

Untitled

a guest
Jan 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def helloworld():
  2. return "hello world"
  3.  
  4. def helloworld_helper():
  5. return helloworld()
  6.  
  7. import mylibrarywithlongname as ml
  8. from mock import MagicMock
  9.  
  10. def test():
  11. ml.helloworld = MagicMock(return_value="oops")
  12. print(ml.helloworld_helper())
  13.  
  14. print(ml.helloworld_helper())
  15. test()
  16. print(ml.helloworld_helper())
  17.  
  18. hello world
  19. oops
  20. oops
Add Comment
Please, Sign In to add comment