'Test sending a disco#info query to another entity
and receiving the result.'

def testGetInfoRemote(self):

    self.stream_start(mode='client', plugins=['xep_0030'])
    events = set()
    def handle_disco_info(iq):
        events.add('disco_info')
    self.xmpp.add_event_handler('disco_info', handle_disco_info)
    t = threading.Thread(name='get_info', target=self.xmpp['xep_0030'].get_info, args=('user@localhost', 'foo'))
    t.start()
    self.send('\n                                        <iq    type="get"    to="user@localhost"    id="1">\n                                                <query    xmlns="http://jabber.org/protocol/disco#info"\n                                                                            node="foo"    />\n                                        </iq>\n                                ')
    self.recv('\n                                        <iq    type="result"    to="tester@localhost"    id="1">\n                                                <query    xmlns="http://jabber.org/protocol/disco#info"\n                                                                            node="foo">\n                                                        <identity    category="client"    type="bot"    />\n                                                        <feature    var="urn:xmpp:ping"    />\n                                                </query>\n                                        </iq>\n                                ')
    t.join()
    time.sleep(0.1)
    self.assertEqual(events, set(('disco_info',)), ('Disco    info    event    was    not    triggered:    %s' % events))
