Ignore:
Timestamp:
May 6, 2013, 9:15:41 PM (7 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Deprecate prepareIDNName.

C{unicode.encode('idna')} does exactly the same as the recently
introduced L{generic.prepareIDNName}.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/test/test_generic.py

    r178 r184  
    66"""
    77
     8import re
     9
     10from twisted.python import deprecate
     11from twisted.python.versions import Version
    812from twisted.trial import unittest
     13from twisted.trial.util import suppress as SUPPRESS
    914from twisted.words.xish import domish
    1015from twisted.words.protocols.jabber.jid import JID
     
    277282    """
    278283
     284    suppress = [SUPPRESS(category=DeprecationWarning,
     285                         message=re.escape(
     286                             deprecate.getDeprecationWarningString(
     287                                 generic.prepareIDNName,
     288                                 Version("Wokkel", 0, 8, 0),
     289                                 replacement="unicode.encode('idna')")))]
     290
     291
     292    def test_deprecated(self):
     293        """
     294        prepareIDNName is deprecated.
     295        """
     296        self.callDeprecated((Version("Wokkel", 0, 8, 0),
     297                             "unicode.encode('idna')"),
     298                            generic.prepareIDNName, (b"example.com"))
     299    test_deprecated.suppress = []
     300
     301
    279302    def test_bytestring(self):
    280303        """
Note: See TracChangeset for help on using the changeset viewer.