From 80e7e0d0ee45acf5641f630c0f858a91cbf1a222 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 14 Apr 2010 01:23:17 -0700 Subject: adding tests, fixed stanzapath matching to match keys, fixed pubsub#owner stanzas --- tests/test_pubsubstanzas.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'tests') 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 = """This thing is awesome""" + iq['pubsub_owner']['default']['config'] = form + xmlstring = """This thing is awesome""" 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 = """""" + 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) -- cgit v1.2.3