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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.