Esempio n. 1
0
 def test_unicodeHalfwidthIdeographicFullStop(self):
     """
     Exotic dots in unicode names are converted to Full Stop.
     """
     name = u"\u00e9chec.example\uff61com"
     result = generic.prepareIDNName(name)
     self.assertEqual(b"xn--chec-9oa.example.com", result)
Esempio n. 2
0
 def test_unicode(self):
     """
     A unicode all-ASCII name is converted to an ASCII byte string.
     """
     name = u"example.com"
     result = generic.prepareIDNName(name)
     self.assertEqual(b"example.com", result)
Esempio n. 3
0
 def test_unicodeNonASCII(self):
     """
     A unicode with non-ASCII is converted to its ACE equivalent.
     """
     name = u"\u00e9chec.example.com"
     result = generic.prepareIDNName(name)
     self.assertEqual(b"xn--chec-9oa.example.com", result)
Esempio n. 4
0
 def test_unicodeHalfwidthIdeographicFullStop(self):
     """
     Exotic dots in unicode names are converted to Full Stop.
     """
     name = u"\u00e9chec.example\uff61com"
     result = generic.prepareIDNName(name)
     self.assertEqual(b"xn--chec-9oa.example.com", result)
Esempio n. 5
0
 def test_unicodeNonASCII(self):
     """
     A unicode with non-ASCII is converted to its ACE equivalent.
     """
     name = u"\u00e9chec.example.com"
     result = generic.prepareIDNName(name)
     self.assertEqual(b"xn--chec-9oa.example.com", result)
Esempio n. 6
0
 def test_unicode(self):
     """
     A unicode all-ASCII name is converted to an ASCII byte string.
     """
     name = u"example.com"
     result = generic.prepareIDNName(name)
     self.assertEqual(b"example.com", result)
Esempio n. 7
0
 def test_bytestring(self):
     """
     An ASCII-encoded byte string is left as-is.
     """
     name = b"example.com"
     result = generic.prepareIDNName(name)
     self.assertEqual(b"example.com", result)
Esempio n. 8
0
 def test_bytestring(self):
     """
     An ASCII-encoded byte string is left as-is.
     """
     name = b"example.com"
     result = generic.prepareIDNName(name)
     self.assertEqual(b"example.com", result)
Esempio n. 9
0
    def __init__(self, jid, password, host=None, port=5222):
        self.jid = jid
        self.domain = generic.prepareIDNName(jid.host)
        self.host = host
        self.port = port

        factory = HybridClientFactory(jid, password)

        StreamManager.__init__(self, factory)
Esempio n. 10
0
    def test_unicodeTrailingDot(self):
        """
        Unicode names with trailing dots retain the trailing dot.

        L{encodings.idna.ToASCII} doesn't allow the empty string as the input,
        hence the implementation needs to strip a trailing dot, and re-add it
        after encoding the labels.
        """
        name = u"example.com."
        result = generic.prepareIDNName(name)
        self.assertEqual(b"example.com.", result)
Esempio n. 11
0
    def test_unicodeTrailingDot(self):
        """
        Unicode names with trailing dots retain the trailing dot.

        L{encodings.idna.ToASCII} doesn't allow the empty string as the input,
        hence the implementation needs to strip a trailing dot, and re-add it
        after encoding the labels.
        """
        name = u"example.com."
        result = generic.prepareIDNName(name)
        self.assertEqual(b"example.com.", result)
Esempio n. 12
0
def initiateS2S(factory):
    domain = prepareIDNName(factory.authenticator.otherHost)
    c = XMPPServerConnector(reactor, domain, factory)
    c.connect()
    return factory.deferred
Esempio n. 13
0
def clientCreator(factory):
    domain = generic.prepareIDNName(factory.authenticator.jid.host)
    c = XMPPClientConnector(reactor, domain, factory)
    c.connect()
    return factory.deferred
Esempio n. 14
0
def initiateS2S(factory):
    domain = prepareIDNName(factory.authenticator.otherHost)
    c = XMPPServerConnector(reactor, domain, factory)
    c.connect()
    return factory.deferred