Commits

Konstantine Rybnikov committed 3aa625d

add test for passing parameters

  • Participants
  • Parent commits 223ef1c

Comments (0)

Files changed (1)

 import unittest
 from unittest import TestCase
 from mock import Mock
+from mock import patch
 
 from mockstar import p
 from mockstar import DotDict
     return 4
 
 
+def side_effect_five(n):
+    return n
+
+
 class TestDotDict(TestCase):
     def test_should_setattr_getattr(self):
         d = DotDict()
 
         self.assertEquals(result, 2)
 
+    @p(__name__ + '.side_effect_five', autospec=True)
+    @patch('mockstar.patch')
+    def test_should_pass_mock_parameters(self, mockstar_patch_mock, se):
+        se.side_effect_five(10)
+        self.assertRaises(TypeError, lambda: se.side_effect_five())
+
 
 if __name__ == '__main__':
     unittest.main()