How to use slixmpp - 10 common examples

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_plugins.py View on Github external
name = 'd'
    dependencies = {'c'}


class E(BasePlugin):
    name = 'e'
    dependencies = {'a', 'd'}

class F(BasePlugin):
    name = 'f'
    dependencies = {'a', 'b'}


register_plugin(A)
register_plugin(B)
register_plugin(C)
register_plugin(D)
register_plugin(E)
register_plugin(F)


class TestPlugins(unittest.TestCase):


    def test_enable(self):
        """Enable a single plugin."""
        p = PluginManager(None)

        events = []

        def init(self):
            events.append('init')
github poezio / slixmpp / tests / test_plugins.py View on Github external
class E(BasePlugin):
    name = 'e'
    dependencies = {'a', 'd'}

class F(BasePlugin):
    name = 'f'
    dependencies = {'a', 'b'}


register_plugin(A)
register_plugin(B)
register_plugin(C)
register_plugin(D)
register_plugin(E)
register_plugin(F)


class TestPlugins(unittest.TestCase):


    def test_enable(self):
        """Enable a single plugin."""
        p = PluginManager(None)

        events = []

        def init(self):
            events.append('init')

        A.plugin_init = init
github poezio / slixmpp / tests / test_stanza_gmail.py View on Github external
def testMailBox(self):
        """Testing reading from Gmail mailbox result"""

        # Use the example from Google's documentation at
        # http://code.google.com/apis/talk/jep_extensions/gmail.html#notifications
        xml = ET.fromstring("""
          
            
              
                
                  
                  
                  
github poezio / slixmpp / tests / test_plugins.py View on Github external
class D(BasePlugin):
    name = 'd'
    dependencies = {'c'}


class E(BasePlugin):
    name = 'e'
    dependencies = {'a', 'd'}

class F(BasePlugin):
    name = 'f'
    dependencies = {'a', 'b'}


register_plugin(A)
register_plugin(B)
register_plugin(C)
register_plugin(D)
register_plugin(E)
register_plugin(F)


class TestPlugins(unittest.TestCase):


    def test_enable(self):
        """Enable a single plugin."""
        p = PluginManager(None)

        events = []
github poezio / slixmpp / tests / test_stanza_xep_0047.py View on Github external
def testConvertData(self):
        """Test that data is converted to base64"""
        iq = Iq()
        iq['type'] = 'set'
        iq['ibb_data']['seq'] = 0
        iq['ibb_data']['data'] = 'slixmpp'

        self.check(iq, """
github poezio / slixmpp / tests / test_stanza_xep_0047.py View on Github external
def setUp(self):
        register_stanza_plugin(Iq, Data)
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)