'Test interaction between XEP-0030 and XEP-0059 plugins.'

def testGetItemsIterator(self):

    raised_exceptions = []
    self.stream_start(mode='client', plugins=['xep_0030', 'xep_0059'])
    results = self.xmpp['xep_0030'].get_items(jid='foo@localhost', node='bar', iterator=True)
    results.amount = 10
    def run_test():
        try:
            results.next()
        except StopIteration:
            raised_exceptions.append(True)
    t = threading.Thread(name='get_items_iterator', target=run_test)
    t.start()
    self.send('\n                                        <iq    id="2"    type="get"    to="foo@localhost">\n                                                <query    xmlns="http://jabber.org/protocol/disco#items"\n                                                                            node="bar">\n                                                        <set    xmlns="http://jabber.org/protocol/rsm">\n                                                                <max>10</max>\n                                                        </set>\n                                                </query>\n                                        </iq>\n                                ')
    self.recv('\n                                        <iq    id="2"    type="result"    to="tester@localhost">\n                                                <query    xmlns="http://jabber.org/protocol/disco#items">\n                                                        <set    xmlns="http://jabber.org/protocol/rsm">\n                                                        </set>\n                                                </query>\n                                        </iq>\n                                ')
    t.join()
    self.assertEqual(raised_exceptions, [True], ('StopIteration    was    not    raised:    %s' % raised_exceptions))
