How to use the slixmpp.JID function in slixmpp

To help you get started, we’ve selected a few slixmpp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github poezio / slixmpp / tests / test_jid.py View on Github external
def testJIDEscapeExistingSequences(self):
        jid = JID(local='blah\\foo\\20bar', domain='example.com')
        self.assertEqual(jid.local, 'blah\\foo\\5c20bar')
github poezio / slixmpp / tests / test_jid.py View on Github external
def testJIDInequality(self):
        jid1 = JID('user@domain/resource')
        jid2 = JID('otheruser@domain/resource')
        self.assertFalse(jid1 == jid2, "Same JIDs are not considered equal")
        self.assertTrue(jid1 != jid2, "Same JIDs are considered not equal")
github poezio / slixmpp / tests / test_jid.py View on Github external
def testDomainInvalidIPv6MissingBracket(self):
        domain = '[::1'
        jid1 = JID(domain=domain)
        jid2 = JID('user@%s/resource' % domain)

        self.assertEqual(jid1.domain, '[::1]')
        self.assertEqual(jid2.domain, '[::1]')
github poezio / slixmpp / tests / test_jid.py View on Github external
def test1023LengthResource(self):
        resource = 'r' * 1023
        jid1 = JID(domain='test.com', resource=resource)
        jid2 = JID('test.com/%s' % resource)
github poezio / slixmpp / tests / test_jid.py View on Github external
def testJIDFromFull(self):
        """Test using JID of the form 'user@server/resource/with/slashes'."""
        self.check_jid(JID('user@someserver/some/resource'),
                       'user',
                       'someserver',
                       'some/resource',
                       'user@someserver',
                       'user@someserver/some/resource',
                       'user@someserver/some/resource')
github poezio / slixmpp / tests / test_jid.py View on Github external
def testDomainEmptyLabel(self):
        domain = 'aaa..bbb.com'
        self.assertRaises(InvalidJID, JID, domain=domain)
        self.assertRaises(InvalidJID, JID, 'user@%s/resource' % domain)
github poezio / slixmpp / tests / test_jid.py View on Github external
def testJIDSetFullWithUser(self):
        """Test setting the full JID with a user portion."""
        j = JID('user@domain/resource')
        j.full = 'otheruser@otherdomain/otherresource'
        self.check_jid(j,
                       'otheruser',
                       'otherdomain',
                       'otherresource',
                       'otheruser@otherdomain',
                       'otheruser@otherdomain/otherresource',
                       'otheruser@otherdomain/otherresource')
github poezio / slixmpp / tests / test_jid.py View on Github external
def test1023LengthDomain(self):
        domain = ('a.' * 509) + 'a.com'
        jid1 = JID(domain=domain)
        jid2 = JID('user@%s/resource' % domain)
github poezio / slixmpp / tests / test_jid.py View on Github external
def testJIDBareUser(self):
        """Test setting the bare JID with a user."""
        j = JID('user@domain/resource')
        j.bare = 'otheruser@otherdomain'
        self.check_jid(j,
                       'otheruser',
                       'otherdomain',
                       'resource',
                       'otheruser@otherdomain',
                       'otheruser@otherdomain/resource',
                       'otheruser@otherdomain/resource')
github poezio / slixmpp / tests / test_jid.py View on Github external
def testDomainIPv6(self):
        domain = '[::1]'
        jid1 = JID(domain=domain)
        jid2 = JID('user@%s/resource' % domain)