'Test for PLAIN connection via python-saslwrapper, sans cyrus-sasl-plain
This test is specific for what is returned when we attempt to connect
with PLAIN mech and python-saslwrapper is installed, but
cyrus-sasl-plain is not installed.'

@patch((QPID_MODULE + u'.ConnectionError'), new=(QpidException,))
@patch((QPID_MODULE + u'.sys.exc_info'))
@patch((QPID_MODULE + u'.qpid'))
def test_connection__init__mutates_ConnError_by_message2(self, mock_qpid, mock_exc_info):

    my_conn_error = QpidException()
    my_conn_error.text = u'Error    in    sasl_client_start    (-4)    SASL(-4):    no    mechanism    available'
    mock_qpid.messaging.Connection.establish.side_effect = my_conn_error
    mock_exc_info.return_value = (u'a', u'b', None)
    try:
        self.conn = Connection(**self.connection_options)
    except AuthenticationFailure as error:
        exc_info = sys.exc_info()
        assert (not isinstance(error, QpidException))
        assert (exc_info[1] == u'b')
        assert (exc_info[2] is None)
    else:
        self.fail(u'ConnectionError    type    was    not    mutated    correctly')
