'Check that a given stream header was sent.
Arguments:
sto        -- The recipient of the stream header.
sfrom      -- The agent sending the stream header.
sid        -- The stream\'s id.
stream_ns  -- The namespace of the stream\'s root element.
default_ns -- The default stanza namespace.
version    -- The stream version.
xml_header -- Indicates if the XML version header should be
appended before the stream header.
timeout    -- Length of time to wait in seconds for a
response.'

def send_header(self, sto='', sfrom='', sid='', stream_ns='http://etherx.jabber.org/streams', default_ns='jabber:client', default_lang='en', version='1.0', xml_header=False, timeout=1):

    header = self.make_header(sto, sfrom, sid, stream_ns=stream_ns, default_ns=default_ns, default_lang=default_lang, version=version, xml_header=xml_header)
    sent_header = self.xmpp.socket.next_sent(timeout)
    if (sent_header is None):
        raise ValueError('Socket    did    not    return    data.')
    header2 = (header + '</stream:stream>')
    sent_header2 = (sent_header + '</stream:stream>')
    xml = self.parse_xml(header2)
    sent_xml = self.parse_xml(sent_header2)
    self.failUnless(self.compare(xml, sent_xml), ('Stream    headers    do    not    match:\nDesired:\n%s\nSent:\n%s' % (header, sent_header)))
