Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from mock import patch, Mock
- sys.modules['cv2'] = Mock()
- from MyClass import MyClass
- del sys.modules['cv2']
- ....
- def testFunction()
- myObject = MyClass()
- self.assertEqual(myObject.val, ?) # here i don't know how to test the equality
- import module
- val1 = cv2.function(1)
- val2 = cv2.function(2)
- class MyClass():
- def _init(self)
- self.val = val1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement