コード例 #1
0
 def test_ignore_exceptions1(self):
     """Get exception"""
     self.obj1.side_effect = Exception()
     wrapped = cmd.ignore_exceptions(self.obj1)
     wrapped()
     self.assertTrue(self.obj1.call_args_list, Exception)
コード例 #2
0
 def test_ignore_exceptions0(self):
     """Don't get exception"""
     wrapped = cmd.ignore_exceptions(self.obj1)
     wrapped("arg1", "arg2")
     self.assertEquals([mock.call("arg1", "arg2")],
             self.obj1.call_args_list)