Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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')
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
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("""
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 = []
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, """
def setUp(self):
register_stanza_plugin(Iq, Data)
def testJIDEscapeExistingSequences(self):
jid = JID(local='blah\\foo\\20bar', domain='example.com')
self.assertEqual(jid.local, 'blah\\foo\\5c20bar')
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")
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]')
def test1023LengthResource(self):
resource = 'r' * 1023
jid1 = JID(domain='test.com', resource=resource)
jid2 = JID('test.com/%s' % resource)