From 212660091f155255ee9f45cdfca7969d8313309c Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Mon, 19 Apr 2010 01:03:27 -0700 Subject: added pubsub tests and fixed match on iterator error --- tests/test_pubsubstanzas.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/test_pubsubstanzas.py') diff --git a/tests/test_pubsubstanzas.py b/tests/test_pubsubstanzas.py index ed37314d..2d1bf3b7 100644 --- a/tests/test_pubsubstanzas.py +++ b/tests/test_pubsubstanzas.py @@ -85,12 +85,11 @@ class testpubsubstanzas(unittest.TestCase): "Testing iq/pubsub/create&configure stanzas" from sleekxmpp.plugins import xep_0004 iq = self.ps.Iq() - iq['pubsub']['create']['configure'] iq['pubsub']['create']['node'] = 'mynode' form = xep_0004.Form() form.addField('pubsub#title', ftype='text-single', value='This thing is awesome') - iq['pubsub']['create']['configure']['config'] = form - xmlstring = """This thing is awesome""" + iq['pubsub']['configure']['config'] = form + xmlstring = """This thing is awesome""" iq2 = self.ps.Iq(None, self.ps.ET.fromstring(xmlstring)) iq3 = self.ps.Iq() values = iq2.getValues() @@ -162,5 +161,12 @@ class testpubsubstanzas(unittest.TestCase): iq3 = self.ps.Iq() iq3.setValues(iq2.getValues()) self.failUnless(xmlstring == str(iq) == str(iq2) == str(iq3)) + + def testCreateConfigGet(self): + """Testing getting config from full create""" + xml = """http://jabber.org/protocol/pubsub#node_configleaf111101openpublishersnever""" + iq = self.ps.Iq(None, self.ps.ET.fromstring(xml)) + config = iq['pubsub']['configure']['config'] + self.failUnless(config.getValues() != {}) suite = unittest.TestLoader().loadTestsFromTestCase(testpubsubstanzas) -- cgit v1.2.3