summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNathan Fritz <nathan@andyet.net>2010-04-14 01:23:17 -0700
committerNathan Fritz <nathan@andyet.net>2010-04-14 01:23:17 -0700
commit80e7e0d0ee45acf5641f630c0f858a91cbf1a222 (patch)
treec8dad5af2fcd57c24e7f0ebe2f9284a171a19c1f /tests
parent2f9f649d98682817c900736c6775ba8e5b23060f (diff)
downloadslixmpp-80e7e0d0ee45acf5641f630c0f858a91cbf1a222.tar.gz
slixmpp-80e7e0d0ee45acf5641f630c0f858a91cbf1a222.tar.bz2
slixmpp-80e7e0d0ee45acf5641f630c0f858a91cbf1a222.tar.xz
slixmpp-80e7e0d0ee45acf5641f630c0f858a91cbf1a222.zip
adding tests, fixed stanzapath matching to match keys, fixed pubsub#owner stanzas
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pubsubstanzas.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/test_pubsubstanzas.py b/tests/test_pubsubstanzas.py
index 4f9faf75..ed37314d 100644
--- a/tests/test_pubsubstanzas.py
+++ b/tests/test_pubsubstanzas.py
@@ -98,15 +98,15 @@ class testpubsubstanzas(unittest.TestCase):
self.failUnless(xmlstring == str(iq) == str(iq2) == str(iq3))
def testDefault(self):
- "Testing iq/default stanzas"
+ "Testing iq/pubsub_owner/default stanzas"
from sleekxmpp.plugins import xep_0004
iq = self.ps.Iq()
- iq['pubsub']['default']
- iq['pubsub']['default']['node'] = 'mynode'
+ iq['pubsub_owner']['default']
+ iq['pubsub_owner']['default']['node'] = 'mynode'
form = xep_0004.Form()
form.addField('pubsub#title', ftype='text-single', value='This thing is awesome')
- iq['pubsub']['default']['config'] = form
- xmlstring = """<iq id="0"><pubsub xmlns="http://jabber.org/protocol/pubsub"><default node="mynode"><x xmlns="jabber:x:data" type="form"><field var="pubsub#title" type="text-single"><value>This thing is awesome</value></field></x></default></pubsub></iq>"""
+ iq['pubsub_owner']['default']['config'] = form
+ xmlstring = """<iq id="0"><pubsub xmlns="http://jabber.org/protocol/pubsub#owner"><default node="mynode"><x xmlns="jabber:x:data" type="form"><field var="pubsub#title" type="text-single"><value>This thing is awesome</value></field></x></default></pubsub></iq>"""
iq2 = self.ps.Iq(None, self.ps.ET.fromstring(xmlstring))
iq3 = self.ps.Iq()
values = iq2.getValues()
@@ -151,11 +151,16 @@ class testpubsubstanzas(unittest.TestCase):
iq3 = self.ps.Iq()
values = iq2.getValues()
iq3.setValues(values)
- #print()
- #print(xmlstring)
- #print(iq)
- #print(iq2)
- #print(iq3)
+ self.failUnless(xmlstring == str(iq) == str(iq2) == str(iq3))
+
+ def testDelete(self):
+ "Testing iq/pubsub_owner/delete stanzas"
+ iq = self.ps.Iq()
+ iq['pubsub_owner']['delete']['node'] = 'thingers'
+ xmlstring = """<iq id="0"><pubsub xmlns="http://jabber.org/protocol/pubsub#owner"><delete node="thingers" /></pubsub></iq>"""
+ iq2 = self.ps.Iq(None, self.ps.ET.fromstring(xmlstring))
+ iq3 = self.ps.Iq()
+ iq3.setValues(iq2.getValues())
self.failUnless(xmlstring == str(iq) == str(iq2) == str(iq3))
suite = unittest.TestLoader().loadTestsFromTestCase(testpubsubstanzas)