Refactored unit tests for XEP-0030, XEP-0033, and XEP-0085 to use the new SleekTest class.
This commit is contained in:
parent
37ada49802
commit
7f8179d91e
3 changed files with 169 additions and 124 deletions
|
@ -1,83 +1,110 @@
|
||||||
import unittest
|
from sleektest import *
|
||||||
from xml.etree import cElementTree as ET
|
import sleekxmpp.plugins.xep_0033 as xep_0033
|
||||||
from sleekxmpp.xmlstream.matcher.stanzapath import StanzaPath
|
|
||||||
from . import xmlcompare
|
|
||||||
|
|
||||||
import sleekxmpp.plugins.xep_0033 as addr
|
|
||||||
|
|
||||||
|
|
||||||
def stanzaPlugin(stanza, plugin):
|
class TestAddresses(SleekTest):
|
||||||
stanza.plugin_attrib_map[plugin.plugin_attrib] = plugin
|
|
||||||
stanza.plugin_tag_map["{%s}%s" % (plugin.namespace, plugin.name)] = plugin
|
|
||||||
|
|
||||||
|
|
||||||
class testaddresses(unittest.TestCase):
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.addr = addr
|
self.stanzaPlugin(Message, xep_0033.Addresses)
|
||||||
stanzaPlugin(self.addr.Message, self.addr.Addresses)
|
|
||||||
|
|
||||||
def try2Methods(self, xmlstring, msg):
|
|
||||||
msg2 = self.addr.Message(None, self.addr.ET.fromstring(xmlstring))
|
|
||||||
self.failUnless(xmlstring == str(msg) == str(msg2),
|
|
||||||
"""Three methods for creating stanza don't match:\n%s\n%s\n%s""" % (xmlstring, str(msg), str(msg2)))
|
|
||||||
|
|
||||||
def testAddAddress(self):
|
def testAddAddress(self):
|
||||||
"""Testing adding extended stanza address."""
|
"""Testing adding extended stanza address."""
|
||||||
xmlstring = """<message><addresses xmlns="http://jabber.org/protocol/address"><address jid="to@header1.org" type="to" /></addresses></message>"""
|
msg = self.Message()
|
||||||
|
|
||||||
msg = self.addr.Message()
|
|
||||||
msg['addresses'].addAddress(atype='to', jid='to@header1.org')
|
msg['addresses'].addAddress(atype='to', jid='to@header1.org')
|
||||||
self.try2Methods(xmlstring, msg)
|
self.checkMessage(msg, """
|
||||||
|
<message>
|
||||||
|
<addresses xmlns="http://jabber.org/protocol/address">
|
||||||
|
<address jid="to@header1.org" type="to" />
|
||||||
|
</addresses>
|
||||||
|
</message>
|
||||||
|
""")
|
||||||
|
|
||||||
xmlstring = """<message><addresses xmlns="http://jabber.org/protocol/address"><address jid="replyto@header1.org" type="replyto" desc="Reply address" /></addresses></message>"""
|
msg = self.Message()
|
||||||
|
msg['addresses'].addAddress(atype='replyto',
|
||||||
msg = self.addr.Message()
|
jid='replyto@header1.org',
|
||||||
msg['addresses'].addAddress(atype='replyto', jid='replyto@header1.org', desc='Reply address')
|
desc='Reply address')
|
||||||
self.try2Methods(xmlstring, msg)
|
self.checkMessage(msg, """
|
||||||
|
<message>
|
||||||
|
<addresses xmlns="http://jabber.org/protocol/address">
|
||||||
|
<address jid="replyto@header1.org" type="replyto" desc="Reply address" />
|
||||||
|
</addresses>
|
||||||
|
</message>
|
||||||
|
""")
|
||||||
|
|
||||||
def testAddAddresses(self):
|
def testAddAddresses(self):
|
||||||
"""Testing adding multiple extended stanza addresses."""
|
"""Testing adding multiple extended stanza addresses."""
|
||||||
|
|
||||||
xmlstring = """<message><addresses xmlns="http://jabber.org/protocol/address"><address jid="replyto@header1.org" type="replyto" desc="Reply address" /><address jid="cc@header2.org" type="cc" /><address jid="bcc@header2.org" type="bcc" /></addresses></message>"""
|
xmlstring = """
|
||||||
|
<message>
|
||||||
|
<addresses xmlns="http://jabber.org/protocol/address">
|
||||||
|
<address jid="replyto@header1.org" type="replyto" desc="Reply address" />
|
||||||
|
<address jid="cc@header2.org" type="cc" />
|
||||||
|
<address jid="bcc@header2.org" type="bcc" />
|
||||||
|
</addresses>
|
||||||
|
</message>
|
||||||
|
"""
|
||||||
|
|
||||||
msg = self.addr.Message()
|
msg = self.Message()
|
||||||
msg['addresses'].setAddresses([{'type':'replyto', 'jid':'replyto@header1.org', 'desc':'Reply address'},
|
msg['addresses'].setAddresses([{'type':'replyto',
|
||||||
{'type':'cc', 'jid':'cc@header2.org'},
|
'jid':'replyto@header1.org',
|
||||||
{'type':'bcc', 'jid':'bcc@header2.org'}])
|
'desc':'Reply address'},
|
||||||
self.try2Methods(xmlstring, msg)
|
{'type':'cc',
|
||||||
|
'jid':'cc@header2.org'},
|
||||||
|
{'type':'bcc',
|
||||||
|
'jid':'bcc@header2.org'}])
|
||||||
|
self.checkMessage(msg, xmlstring)
|
||||||
|
|
||||||
msg = self.addr.Message()
|
msg = self.Message()
|
||||||
msg['addresses']['replyto'] = [{'jid':'replyto@header1.org', 'desc':'Reply address'}]
|
msg['addresses']['replyto'] = [{'jid':'replyto@header1.org',
|
||||||
|
'desc':'Reply address'}]
|
||||||
msg['addresses']['cc'] = [{'jid':'cc@header2.org'}]
|
msg['addresses']['cc'] = [{'jid':'cc@header2.org'}]
|
||||||
msg['addresses']['bcc'] = [{'jid':'bcc@header2.org'}]
|
msg['addresses']['bcc'] = [{'jid':'bcc@header2.org'}]
|
||||||
self.try2Methods(xmlstring, msg)
|
self.checkMessage(msg, xmlstring)
|
||||||
|
|
||||||
def testAddURI(self):
|
def testAddURI(self):
|
||||||
"""Testing adding URI attribute to extended stanza address."""
|
"""Testing adding URI attribute to extended stanza address."""
|
||||||
|
|
||||||
xmlstring = """<message><addresses xmlns="http://jabber.org/protocol/address"><address node="foo" jid="to@header1.org" type="to" /></addresses></message>"""
|
msg = self.Message()
|
||||||
msg = self.addr.Message()
|
addr = msg['addresses'].addAddress(atype='to',
|
||||||
addr = msg['addresses'].addAddress(atype='to', jid='to@header1.org', node='foo')
|
jid='to@header1.org',
|
||||||
self.try2Methods(xmlstring, msg)
|
node='foo')
|
||||||
|
self.checkMessage(msg, """
|
||||||
|
<message>
|
||||||
|
<addresses xmlns="http://jabber.org/protocol/address">
|
||||||
|
<address node="foo" jid="to@header1.org" type="to" />
|
||||||
|
</addresses>
|
||||||
|
</message>
|
||||||
|
""")
|
||||||
|
|
||||||
xmlstring = """<message><addresses xmlns="http://jabber.org/protocol/address"><address type="to" uri="mailto:to@header2.org" /></addresses></message>"""
|
|
||||||
addr['uri'] = 'mailto:to@header2.org'
|
addr['uri'] = 'mailto:to@header2.org'
|
||||||
self.try2Methods(xmlstring, msg)
|
self.checkMessage(msg, """
|
||||||
|
<message>
|
||||||
|
<addresses xmlns="http://jabber.org/protocol/address">
|
||||||
|
<address type="to" uri="mailto:to@header2.org" />
|
||||||
|
</addresses>
|
||||||
|
</message>
|
||||||
|
""")
|
||||||
|
|
||||||
def testDelivered(self):
|
def testDelivered(self):
|
||||||
"""Testing delivered attribute of extended stanza addresses."""
|
"""Testing delivered attribute of extended stanza addresses."""
|
||||||
|
|
||||||
xmlstring = """<message><addresses xmlns="http://jabber.org/protocol/address"><address %sjid="to@header1.org" type="to" /></addresses></message>"""
|
xmlstring = """
|
||||||
|
<message>
|
||||||
|
<addresses xmlns="http://jabber.org/protocol/address">
|
||||||
|
<address %s jid="to@header1.org" type="to" />
|
||||||
|
</addresses>
|
||||||
|
</message>
|
||||||
|
"""
|
||||||
|
|
||||||
msg = self.addr.Message()
|
msg = self.Message()
|
||||||
addr = msg['addresses'].addAddress(jid='to@header1.org', atype='to')
|
addr = msg['addresses'].addAddress(jid='to@header1.org', atype='to')
|
||||||
self.try2Methods(xmlstring % '', msg)
|
self.checkMessage(msg, xmlstring % '')
|
||||||
|
|
||||||
addr['delivered'] = True
|
addr['delivered'] = True
|
||||||
self.try2Methods(xmlstring % 'delivered="true" ', msg)
|
self.checkMessage(msg, xmlstring % 'delivered="true"')
|
||||||
|
|
||||||
addr['delivered'] = False
|
addr['delivered'] = False
|
||||||
self.try2Methods(xmlstring % '', msg)
|
self.checkMessage(msg, xmlstring % '')
|
||||||
|
|
||||||
|
|
||||||
suite = unittest.TestLoader().loadTestsFromTestCase(testaddresses)
|
suite = unittest.TestLoader().loadTestsFromTestCase(TestAddresses)
|
||||||
|
|
|
@ -1,47 +1,44 @@
|
||||||
import unittest
|
from sleektest import *
|
||||||
from xml.etree import cElementTree as ET
|
import sleekxmpp.plugins.xep_0085 as xep_0085
|
||||||
from sleekxmpp.xmlstream.matcher.stanzapath import StanzaPath
|
|
||||||
from . import xmlcompare
|
|
||||||
|
|
||||||
import sleekxmpp.plugins.xep_0085 as cs
|
class TestChatStates(SleekTest):
|
||||||
|
|
||||||
def stanzaPlugin(stanza, plugin):
|
|
||||||
stanza.plugin_attrib_map[plugin.plugin_attrib] = plugin
|
|
||||||
stanza.plugin_tag_map["{%s}%s" % (plugin.namespace, plugin.name)] = plugin
|
|
||||||
|
|
||||||
class testchatstates(unittest.TestCase):
|
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.cs = cs
|
self.stanzaPlugin(Message, xep_0085.Active)
|
||||||
stanzaPlugin(self.cs.Message, self.cs.Active)
|
self.stanzaPlugin(Message, xep_0085.Composing)
|
||||||
stanzaPlugin(self.cs.Message, self.cs.Composing)
|
self.stanzaPlugin(Message, xep_0085.Gone)
|
||||||
stanzaPlugin(self.cs.Message, self.cs.Gone)
|
self.stanzaPlugin(Message, xep_0085.Inactive)
|
||||||
stanzaPlugin(self.cs.Message, self.cs.Inactive)
|
self.stanzaPlugin(Message, xep_0085.Paused)
|
||||||
stanzaPlugin(self.cs.Message, self.cs.Paused)
|
|
||||||
|
|
||||||
def try2Methods(self, xmlstring, msg):
|
|
||||||
msg2 = self.cs.Message(None, self.cs.ET.fromstring(xmlstring))
|
|
||||||
self.failUnless(xmlstring == str(msg) == str(msg2),
|
|
||||||
"Two methods for creating stanza don't match")
|
|
||||||
|
|
||||||
def testCreateChatState(self):
|
def testCreateChatState(self):
|
||||||
"""Testing creating chat states."""
|
"""Testing creating chat states."""
|
||||||
xmlstring = """<message><%s xmlns="http://jabber.org/protocol/chatstates" /></message>"""
|
|
||||||
|
xmlstring = """
|
||||||
|
<message>
|
||||||
|
<%s xmlns="http://jabber.org/protocol/chatstates" />
|
||||||
|
</message>
|
||||||
|
"""
|
||||||
|
|
||||||
msg = self.cs.Message()
|
msg = self.Message()
|
||||||
msg['chat_state'].active()
|
msg['chat_state'].active()
|
||||||
self.try2Methods(xmlstring % 'active', msg)
|
self.checkMessage(msg, xmlstring % 'active',
|
||||||
|
use_values=False)
|
||||||
|
|
||||||
msg['chat_state'].composing()
|
msg['chat_state'].composing()
|
||||||
self.try2Methods(xmlstring % 'composing', msg)
|
self.checkMessage(msg, xmlstring % 'composing',
|
||||||
|
use_values=False)
|
||||||
|
|
||||||
|
|
||||||
msg['chat_state'].gone()
|
msg['chat_state'].gone()
|
||||||
self.try2Methods(xmlstring % 'gone', msg)
|
self.checkMessage(msg, xmlstring % 'gone',
|
||||||
|
use_values=False)
|
||||||
|
|
||||||
msg['chat_state'].inactive()
|
msg['chat_state'].inactive()
|
||||||
self.try2Methods(xmlstring % 'inactive', msg)
|
self.checkMessage(msg, xmlstring % 'inactive',
|
||||||
|
use_values=False)
|
||||||
|
|
||||||
msg['chat_state'].paused()
|
msg['chat_state'].paused()
|
||||||
self.try2Methods(xmlstring % 'paused', msg)
|
self.checkMessage(msg, xmlstring % 'paused',
|
||||||
|
use_values=False)
|
||||||
|
|
||||||
suite = unittest.TestLoader().loadTestsFromTestCase(testchatstates)
|
suite = unittest.TestLoader().loadTestsFromTestCase(TestChatStates)
|
||||||
|
|
|
@ -1,96 +1,118 @@
|
||||||
import unittest
|
from sleektest import *
|
||||||
from xml.etree import cElementTree as ET
|
import sleekxmpp.plugins.xep_0030 as xep_0030
|
||||||
from sleekxmpp.xmlstream.matcher.stanzapath import StanzaPath
|
|
||||||
from . import xmlcompare
|
|
||||||
|
|
||||||
import sleekxmpp.plugins.xep_0030 as sd
|
|
||||||
|
|
||||||
def stanzaPlugin(stanza, plugin):
|
class TestDisco(SleekTest):
|
||||||
stanza.plugin_attrib_map[plugin.plugin_attrib] = plugin
|
|
||||||
stanza.plugin_tag_map["{%s}%s" % (plugin.namespace, plugin.name)] = plugin
|
|
||||||
|
|
||||||
class testdisco(unittest.TestCase):
|
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.sd = sd
|
self.stanzaPlugin(Iq, xep_0030.DiscoInfo)
|
||||||
stanzaPlugin(self.sd.Iq, self.sd.DiscoInfo)
|
self.stanzaPlugin(Iq, xep_0030.DiscoItems)
|
||||||
stanzaPlugin(self.sd.Iq, self.sd.DiscoItems)
|
|
||||||
|
|
||||||
def try3Methods(self, xmlstring, iq):
|
|
||||||
iq2 = self.sd.Iq(None, self.sd.ET.fromstring(xmlstring))
|
|
||||||
values = iq2.getValues()
|
|
||||||
iq3 = self.sd.Iq()
|
|
||||||
iq3.setValues(values)
|
|
||||||
self.failUnless(xmlstring == str(iq) == str(iq2) == str(iq3), str(iq)+"3 methods for creating stanza don't match")
|
|
||||||
|
|
||||||
def testCreateInfoQueryNoNode(self):
|
def testCreateInfoQueryNoNode(self):
|
||||||
"""Testing disco#info query with no node."""
|
"""Testing disco#info query with no node."""
|
||||||
iq = self.sd.Iq()
|
iq = self.Iq()
|
||||||
iq['id'] = "0"
|
iq['id'] = "0"
|
||||||
iq['disco_info']['node'] = ''
|
iq['disco_info']['node'] = ''
|
||||||
xmlstring = """<iq id="0"><query xmlns="http://jabber.org/protocol/disco#info" /></iq>"""
|
|
||||||
self.try3Methods(xmlstring, iq)
|
self.checkIq(iq, """
|
||||||
|
<iq id="0">
|
||||||
|
<query xmlns="http://jabber.org/protocol/disco#info" />
|
||||||
|
</iq>
|
||||||
|
""")
|
||||||
|
|
||||||
def testCreateInfoQueryWithNode(self):
|
def testCreateInfoQueryWithNode(self):
|
||||||
"""Testing disco#info query with a node."""
|
"""Testing disco#info query with a node."""
|
||||||
iq = self.sd.Iq()
|
iq = self.Iq()
|
||||||
iq['id'] = "0"
|
iq['id'] = "0"
|
||||||
iq['disco_info']['node'] = 'foo'
|
iq['disco_info']['node'] = 'foo'
|
||||||
xmlstring = """<iq id="0"><query xmlns="http://jabber.org/protocol/disco#info" node="foo" /></iq>"""
|
|
||||||
self.try3Methods(xmlstring, iq)
|
self.checkIq(iq, """
|
||||||
|
<iq id="0">
|
||||||
|
<query xmlns="http://jabber.org/protocol/disco#info" node="foo" />
|
||||||
|
</iq>
|
||||||
|
""")
|
||||||
|
|
||||||
def testCreateInfoQueryNoNode(self):
|
def testCreateInfoQueryNoNode(self):
|
||||||
"""Testing disco#items query with no node."""
|
"""Testing disco#items query with no node."""
|
||||||
iq = self.sd.Iq()
|
iq = self.Iq()
|
||||||
iq['id'] = "0"
|
iq['id'] = "0"
|
||||||
iq['disco_items']['node'] = ''
|
iq['disco_items']['node'] = ''
|
||||||
xmlstring = """<iq id="0"><query xmlns="http://jabber.org/protocol/disco#items" /></iq>"""
|
|
||||||
self.try3Methods(xmlstring, iq)
|
self.checkIq(iq, """
|
||||||
|
<iq id="0">
|
||||||
|
<query xmlns="http://jabber.org/protocol/disco#items" />
|
||||||
|
</iq>
|
||||||
|
""")
|
||||||
|
|
||||||
def testCreateItemsQueryWithNode(self):
|
def testCreateItemsQueryWithNode(self):
|
||||||
"""Testing disco#items query with a node."""
|
"""Testing disco#items query with a node."""
|
||||||
iq = self.sd.Iq()
|
iq = self.Iq()
|
||||||
iq['id'] = "0"
|
iq['id'] = "0"
|
||||||
iq['disco_items']['node'] = 'foo'
|
iq['disco_items']['node'] = 'foo'
|
||||||
xmlstring = """<iq id="0"><query xmlns="http://jabber.org/protocol/disco#items" node="foo" /></iq>"""
|
|
||||||
self.try3Methods(xmlstring, iq)
|
self.checkIq(iq, """
|
||||||
|
<iq id="0">
|
||||||
|
<query xmlns="http://jabber.org/protocol/disco#items" node="foo" />
|
||||||
|
</iq>
|
||||||
|
""")
|
||||||
|
|
||||||
def testInfoIdentities(self):
|
def testInfoIdentities(self):
|
||||||
"""Testing adding identities to disco#info."""
|
"""Testing adding identities to disco#info."""
|
||||||
iq = self.sd.Iq()
|
iq = self.Iq()
|
||||||
iq['id'] = "0"
|
iq['id'] = "0"
|
||||||
iq['disco_info']['node'] = 'foo'
|
iq['disco_info']['node'] = 'foo'
|
||||||
iq['disco_info'].addIdentity('conference', 'text', 'Chatroom')
|
iq['disco_info'].addIdentity('conference', 'text', 'Chatroom')
|
||||||
xmlstring = """<iq id="0"><query xmlns="http://jabber.org/protocol/disco#info" node="foo"><identity category="conference" type="text" name="Chatroom" /></query></iq>"""
|
|
||||||
self.try3Methods(xmlstring, iq)
|
self.checkIq(iq, """
|
||||||
|
<iq id="0">
|
||||||
|
<query xmlns="http://jabber.org/protocol/disco#info" node="foo">
|
||||||
|
<identity category="conference" type="text" name="Chatroom" />
|
||||||
|
</query>
|
||||||
|
</iq>
|
||||||
|
""")
|
||||||
|
|
||||||
def testInfoFeatures(self):
|
def testInfoFeatures(self):
|
||||||
"""Testing adding features to disco#info."""
|
"""Testing adding features to disco#info."""
|
||||||
iq = self.sd.Iq()
|
iq = self.Iq()
|
||||||
iq['id'] = "0"
|
iq['id'] = "0"
|
||||||
iq['disco_info']['node'] = 'foo'
|
iq['disco_info']['node'] = 'foo'
|
||||||
iq['disco_info'].addFeature('foo')
|
iq['disco_info'].addFeature('foo')
|
||||||
iq['disco_info'].addFeature('bar')
|
iq['disco_info'].addFeature('bar')
|
||||||
xmlstring = """<iq id="0"><query xmlns="http://jabber.org/protocol/disco#info" node="foo"><feature var="foo" /><feature var="bar" /></query></iq>"""
|
|
||||||
self.try3Methods(xmlstring, iq)
|
self.checkIq(iq, """
|
||||||
|
<iq id="0">
|
||||||
|
<query xmlns="http://jabber.org/protocol/disco#info" node="foo">
|
||||||
|
<feature var="foo" />
|
||||||
|
<feature var="bar" />
|
||||||
|
</query>
|
||||||
|
</iq>
|
||||||
|
""")
|
||||||
|
|
||||||
def testItems(self):
|
def testItems(self):
|
||||||
"""Testing adding features to disco#info."""
|
"""Testing adding features to disco#info."""
|
||||||
iq = self.sd.Iq()
|
iq = self.Iq()
|
||||||
iq['id'] = "0"
|
iq['id'] = "0"
|
||||||
iq['disco_items']['node'] = 'foo'
|
iq['disco_items']['node'] = 'foo'
|
||||||
iq['disco_items'].addItem('user@localhost')
|
iq['disco_items'].addItem('user@localhost')
|
||||||
iq['disco_items'].addItem('user@localhost', 'foo')
|
iq['disco_items'].addItem('user@localhost', 'foo')
|
||||||
iq['disco_items'].addItem('user@localhost', 'bar', 'Testing')
|
iq['disco_items'].addItem('user@localhost', 'bar', 'Testing')
|
||||||
xmlstring = """<iq id="0"><query xmlns="http://jabber.org/protocol/disco#items" node="foo"><item jid="user@localhost" /><item node="foo" jid="user@localhost" /><item node="bar" jid="user@localhost" name="Testing" /></query></iq>"""
|
|
||||||
self.try3Methods(xmlstring, iq)
|
self.checkIq(iq, """
|
||||||
|
<iq id="0">
|
||||||
|
<query xmlns="http://jabber.org/protocol/disco#items" node="foo">
|
||||||
|
<item jid="user@localhost" />
|
||||||
|
<item node="foo" jid="user@localhost" />
|
||||||
|
<item node="bar" jid="user@localhost" name="Testing" />
|
||||||
|
</query>
|
||||||
|
</iq>
|
||||||
|
""")
|
||||||
|
|
||||||
def testAddRemoveIdentities(self):
|
def testAddRemoveIdentities(self):
|
||||||
"""Test adding and removing identities to disco#info stanza"""
|
"""Test adding and removing identities to disco#info stanza"""
|
||||||
ids = [('automation', 'commands', 'AdHoc'),
|
ids = [('automation', 'commands', 'AdHoc'),
|
||||||
('conference', 'text', 'ChatRoom')]
|
('conference', 'text', 'ChatRoom')]
|
||||||
|
|
||||||
info = self.sd.DiscoInfo()
|
info = xep_0030.DiscoInfo()
|
||||||
info.addIdentity(*ids[0])
|
info.addIdentity(*ids[0])
|
||||||
self.failUnless(info.getIdentities() == [ids[0]])
|
self.failUnless(info.getIdentities() == [ids[0]])
|
||||||
|
|
||||||
|
@ -110,7 +132,7 @@ class testdisco(unittest.TestCase):
|
||||||
"""Test adding and removing features to disco#info stanza"""
|
"""Test adding and removing features to disco#info stanza"""
|
||||||
features = ['foo', 'bar', 'baz']
|
features = ['foo', 'bar', 'baz']
|
||||||
|
|
||||||
info = self.sd.DiscoInfo()
|
info = xep_0030.DiscoInfo()
|
||||||
info.addFeature(features[0])
|
info.addFeature(features[0])
|
||||||
self.failUnless(info.getFeatures() == [features[0]])
|
self.failUnless(info.getFeatures() == [features[0]])
|
||||||
|
|
||||||
|
@ -132,7 +154,7 @@ class testdisco(unittest.TestCase):
|
||||||
('user@localhost', 'foo', None),
|
('user@localhost', 'foo', None),
|
||||||
('user@localhost', 'bar', 'Test')]
|
('user@localhost', 'bar', 'Test')]
|
||||||
|
|
||||||
info = self.sd.DiscoItems()
|
info = xep_0030.DiscoItems()
|
||||||
self.failUnless(True, ""+str(items[0]))
|
self.failUnless(True, ""+str(items[0]))
|
||||||
|
|
||||||
info.addItem(*(items[0]))
|
info.addItem(*(items[0]))
|
||||||
|
@ -151,5 +173,4 @@ class testdisco(unittest.TestCase):
|
||||||
self.failUnless(info.getItems() == [])
|
self.failUnless(info.getItems() == [])
|
||||||
|
|
||||||
|
|
||||||
|
suite = unittest.TestLoader().loadTestsFromTestCase(TestDisco)
|
||||||
suite = unittest.TestLoader().loadTestsFromTestCase(testdisco)
|
|
||||||
|
|
Loading…
Reference in a new issue