From 8e3168e145da563cc0cca9762ff0c78b65425b73 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Fri, 8 Jan 2010 01:45:11 +0000 Subject: * added first stanza tests * added stanza.keys() * stanza.getValues() now return substanzas and plugins * stanza.setValues() now can read substanzas and plugins * stanzas can now be iterable if stanza.subitem is set to a class --- tests/pubsub_stanzas.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/pubsub_stanzas.py (limited to 'tests') diff --git a/tests/pubsub_stanzas.py b/tests/pubsub_stanzas.py new file mode 100644 index 00000000..2fd6df43 --- /dev/null +++ b/tests/pubsub_stanzas.py @@ -0,0 +1,23 @@ +from sleekxmpp.plugins.stanza_pubsub import * + +def testAffiliations(): + iq = Iq() + aff1 = Affiliation() + aff1['node'] = 'testnode' + aff1['affiliation'] = 'owner' + aff2 = Affiliation() + aff2['node'] = 'testnode2' + aff2['affiliation'] = 'publisher' + iq['pubsub']['affiliations'].append(aff1) + iq['pubsub']['affiliations'].append(aff2) + print(iq) + iq2 = Iq(None, ET.fromstring("""""")) + iq3 = Iq() + values = iq2.getValues() + print(values) + iq3.setValues(values) + print(iq3) + print(str(iq) == str(iq2) == str(iq3)) + + +testAffiliations() -- cgit v1.2.3