'Test that we can interact with a live ClientXMPP instance.'

def testClientConnection(self):

    self.stream_start(mode='client', socket='live', skip=False, jid='user@localhost/test', password='user')
    self.recv_header(sfrom='localhost', sid=None)
    self.send_header(sto='localhost')
    self.recv_feature('\n                                        <stream:features>\n                                                <starttls    xmlns="urn:ietf:params:xml:ns:xmpp-tls"    />\n                                                <mechanisms    xmlns="urn:ietf:params:xml:ns:xmpp-sasl">\n                                                        <mechanism>DIGEST-MD5</mechanism>\n                                                        <mechanism>PLAIN</mechanism>\n                                                </mechanisms>\n                                        </stream:features>\n                                ')
    self.send_feature('\n                                        <starttls    xmlns="urn:ietf:params:xml:ns:xmpp-tls"    />\n                                ')
    self.recv_feature('\n                                        <proceed    xmlns="urn:ietf:params:xml:ns:xmpp-tls"    />\n                                ')
    self.send_header(sto='localhost')
    self.recv_header(sfrom='localhost', sid=None)
    self.recv_feature('\n                                        <stream:features>\n                                                <mechanisms    xmlns="urn:ietf:params:xml:ns:xmpp-sasl">\n                                                        <mechanism>DIGEST-MD5</mechanism>\n                                                        <mechanism>PLAIN</mechanism>\n                                                </mechanisms>\n                                        </stream:features>\n                                ')
    self.send_feature('\n                                        <auth    xmlns="urn:ietf:params:xml:ns:xmpp-sasl"\n                                                                mechanism="PLAIN">AHVzZXIAdXNlcg==</auth>\n                                ')
    self.recv_feature('\n                                        <success    xmlns="urn:ietf:params:xml:ns:xmpp-sasl"    />\n                                ')
    self.send_header(sto='localhost')
    self.recv_header(sfrom='localhost', sid=None)
    self.recv_feature('\n                                        <stream:features>\n                                                <bind    xmlns="urn:ietf:params:xml:ns:xmpp-bind"    />\n                                                <session    xmlns="urn:ietf:params:xml:ns:xmpp-session"    />\n                                        </stream:features>\n                                ')
    self.send_feature('\n                                        <iq    type="set"    id="1">\n                                                <bind    xmlns="urn:ietf:params:xml:ns:xmpp-bind">\n                                                        <resource>test</resource>\n                                                </bind>\n                                        </iq>\n                                ')
    self.recv_feature('\n                                        <iq    type="result"    id="1">\n                                                <bind    xmlns="urn:ietf:params:xml:ns:xmpp-bind">\n                                                        <jid>user@localhost/test</jid>\n                                                </bind>\n                                        </iq>\n                                ')
    self.stream_close()
