'Test using a dynamic items handler for a particular JID.'

def testDynamicItemsJID(self):

    self.stream_start(mode='client', plugins=['xep_0030'])
    def dynamic_jid(jid, node, ifrom, iq):
        result = self.xmpp['xep_0030'].stanza.DiscoItems()
        result['node'] = node
        result.add_item('tester@localhost', node='foo', name='JID')
        return result
    self.xmpp['xep_0030'].set_node_handler('get_items', jid='tester@localhost', handler=dynamic_jid)
    self.recv('\n                                        <iq    type="get"    id="test"    to="tester@localhost">\n                                                <query    xmlns="http://jabber.org/protocol/disco#items"\n                                                                            node="testing"    />\n                                        </iq>\n                                ')
    self.send('\n                                        <iq    type="result"    id="test">\n                                                <query    xmlns="http://jabber.org/protocol/disco#items"\n                                                                            node="testing">\n                                                        <item    jid="tester@localhost"    node="foo"    name="JID"    />\n                                                </query>\n                                        </iq>\n                                ')
