Changeset 195:ff66e31c8607 for wokkel


Ignore:
Timestamp:
Oct 3, 2016, 8:49:10 AM (4 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
rebase_source:
c3bf991ad5b37cfbd90262c6991f0686b0eefbe3
Message:

imported patch py3-generic.patch

Location:
wokkel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wokkel/generic.py

    r194 r195  
    77Generic XMPP protocol helpers.
    88"""
     9
     10from __future__ import division, absolute_import
    911
    1012from zope.interface import implementer
     
    113115        iq.handled = True
    114116
    115     def getDiscoInfo(self, requestor, target, node):
     117    def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
    116118        info = set()
    117119
    118         if not node:
     120        if not nodeIdentifier:
    119121            from wokkel import disco
    120122            info.add(disco.DiscoFeature(NS_VERSION))
     
    122124        return defer.succeed(info)
    123125
    124     def getDiscoItems(self, requestor, target, node):
     126    def getDiscoItems(self, requestor, target, nodeIdentifier=''):
    125127        return defer.succeed([])
    126128
  • wokkel/test/test_generic.py

    r185 r195  
    66"""
    77
     8from __future__ import division, absolute_import
     9
    810import re
    911
     12from zope.interface.verify import verifyObject
     13
    1014from twisted.python import deprecate
     15from twisted.python.compat import unicode
    1116from twisted.python.versions import Version
    1217from twisted.trial import unittest
     
    1621
    1722from wokkel import generic
     23from wokkel.iwokkel import IDisco
    1824from wokkel.test.helpers import XmlStreamStub
    1925
     
    2531    """
    2632
     33    def setUp(self):
     34        self.protocol = generic.VersionHandler('Test', '0.1.0')
     35
     36
     37    def test_interface(self):
     38        """
     39        L{generic.VersionHandler} implements {IDisco}.
     40        """
     41        verifyObject(IDisco, self.protocol)
     42
     43
    2744    def test_onVersion(self):
    2845        """
     
    3047        """
    3148        self.stub = XmlStreamStub()
    32         self.protocol = generic.VersionHandler('Test', '0.1.0')
    3349        self.protocol.xmlstream = self.stub.xmlstream
    3450        self.protocol.send = self.stub.xmlstream.send
     
    320336        self.callDeprecated((Version("Wokkel", 0, 8, 0),
    321337                             "unicode.encode('idna')"),
    322                             generic.prepareIDNName, (b"example.com"))
     338                            generic.prepareIDNName, ("example.com"))
    323339    test_deprecated.suppress = []
    324 
    325 
    326     def test_bytestring(self):
    327         """
    328         An ASCII-encoded byte string is left as-is.
    329         """
    330         name = b"example.com"
    331         result = generic.prepareIDNName(name)
    332         self.assertEqual(b"example.com", result)
    333340
    334341
Note: See TracChangeset for help on using the changeset viewer.