コード例 #1
0
ファイル: test_tasks.py プロジェクト: yangjue-han/agents-aea
 def test_call_positive(self):
     """Test call obj positive result."""
     obj = Task()
     obj.setup = mock.Mock()
     obj.execute = mock.Mock()
     obj.teardown = mock.Mock()
     obj()
コード例 #2
0
ファイル: test_tasks.py プロジェクト: yangjue-han/agents-aea
 def test_call_exception_while_executing(self, debug_mock):
     """Test call obj exception raised while executing."""
     obj = Task()
     obj.setup = mock.Mock()
     obj.execute = _raise_exception
     obj.teardown = mock.Mock()
     obj()
     debug_mock.assert_called_once()
コード例 #3
0
 def test_call_exception_while_executing(self):
     """Test call obj exception raised while executing."""
     obj = Task()
     with mock.patch.object(obj.logger, "debug") as debug_mock:
         obj.setup = mock.Mock()
         obj.execute = _raise_exception
         obj.teardown = mock.Mock()
         obj()
         debug_mock.assert_called_once()