Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. from mock import patch, Mock
  2. sys.modules['cv2'] = Mock()
  3. from MyClass import MyClass
  4. del sys.modules['cv2']
  5.  
  6. ....
  7.  
  8. def testFunction()
  9. myObject = MyClass()
  10. self.assertEqual(myObject.val, ?) # here i don't know how to test the equality
  11.  
  12. import module
  13.  
  14. val1 = cv2.function(1)
  15. val2 = cv2.function(2)
  16.  
  17. class MyClass():
  18. def _init(self)
  19. self.val = val1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement