source: ralphm-patches/py3-test-helpers.patch @ 78:361e2111a663

Last change on this file since 78:361e2111a663 was 78:361e2111a663, checked in by Ralph Meijer <ralphm@…>, 6 years ago

Start port to Python 3.

File size: 1.1 KB
  • wokkel/test/helpers.py

    # HG changeset patch
    # Parent  b7bf25ca839d7ac87cc565a0374110c49de27d18
    
    diff --git a/wokkel/test/helpers.py b/wokkel/test/helpers.py
    a b  
    55Unit test helpers.
    66"""
    77
     8from __future__ import division, absolute_import
     9
    810from twisted.internet import defer
     11from twisted.python.compat import iteritems
    912from twisted.words.xish import xpath
    1013from twisted.words.xish.utility import EventDispatcher
    1114
     
    3437        >>> stub.output[-1].toXml()
    3538        u'<presence/>'
    3639        >>> def cb(stanza):
    37         ...     print "Got: %r" stanza.toXml()
     40        ...     print("Got: %r" stanza.toXml())
    3841        >>> stub.xmlstream.addObserver('/presence')
    3942        >>> stub.send(domish.Element((None, 'presence')))
    4043        Got: u'<presence/>'
     
    8386        """
    8487        handler = None
    8588        iq = parseXml(xml)
    86         for queryString, method in self.service.iqHandlers.iteritems():
     89        for queryString, method in iteritems(self.service.iqHandlers):
    8790            if xpath.internQuery(queryString).matches(iq):
    8891                handler = getattr(self.service, method)
    8992
Note: See TracBrowser for help on using the repository browser.