Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo n.º 12
0
def initiateS2S(factory):
    domain = prepareIDNName(factory.authenticator.otherHost)
    c = XMPPServerConnector(reactor, domain, factory)
    c.connect()
    return factory.deferred
Exemplo n.º 13
0
def clientCreator(factory):
    domain = generic.prepareIDNName(factory.authenticator.jid.host)
    c = XMPPClientConnector(reactor, domain, factory)
    c.connect()
    return factory.deferred
Exemplo n.º 14
0
def initiateS2S(factory):
    domain = prepareIDNName(factory.authenticator.otherHost)
    c = XMPPServerConnector(reactor, domain, factory)
    c.connect()
    return factory.deferred