def test_loop_call_exception_handler_with_custom_exception_handler( loop: GLibEventLoop): exception_handler = Mock() loop.set_exception_handler(exception_handler) mock_exception_context = Mock() loop.call_exception_handler(mock_exception_context) assert exception_handler.call_args_list == [ call(loop, mock_exception_context) ]
def test_loop_get_set_exception_handler(loop: GLibEventLoop): exception_handler = Mock() assert loop.get_exception_handler() is None loop.set_exception_handler(exception_handler) assert loop.get_exception_handler() is exception_handler loop.set_exception_handler(None) assert loop.get_exception_handler() is None