def METHOD_NAME(backend):
    # We're not testing the signal socket here, so mock it
    mocked_signal_socket = MagicMock()
    with patch("UM.Backend.Backend.SignalSocket", MagicMock(return_value = mocked_signal_socket)):
        with patch("UM.Application.Application.getInstance"):
            backend._createSocket("beep")
            if sys.platform == "win32":
                mocked_signal_socket.registerAllMessageTypes.assert_called_once_with(b"beep")
            else:
                mocked_signal_socket.registerAllMessageTypes.assert_called_once_with("beep")
            # Try to create it again.
            backend._createSocket("beep")
            mocked_signal_socket.close.assert_called_once_with()
            backend.close()
            assert mocked_signal_socket.close.call_count == 2