'Pass data to the dummy XMPP client as if it came from an XMPP server.
If using a live connection, verify what the server has sent.
Arguments:
data         -- If a dummy socket is being used, the XML that is to
be received next. Otherwise it is the criteria used
to match against live data that is received.
defaults     -- A list of stanza interfaces with default values that
may interfere with comparisons.
method       -- Select the type of comparison to use for
verifying the received stanza. Options are \'exact\',
\'id\', \'stanzapath\', \'xpath\', and \'mask\'.
Defaults to the value of self.match_method.
use_values   -- Indicates if stanza comparisons should test using
stanza.values. Defaults to True.
timeout      -- Time to wait in seconds for data to be received by
a live connection.'

def recv(self, data, defaults=None, method='exact', use_values=True, timeout=1):

    if (not defaults):
        defaults = []
    if self.xmpp.socket.is_live:
        recv_data = self.xmpp.socket.next_recv(timeout)
        if (recv_data is None):
            self.fail('No    stanza    was    received.')
        xml = self.parse_xml(recv_data)
        self.fix_namespaces(xml, 'jabber:client')
        stanza = self.xmpp._build_stanza(xml, 'jabber:client')
        self.check(stanza, data, method=method, defaults=defaults, use_values=use_values)
    else:
        data = str(data)
        self.xmpp.socket.recv_data(data)
