summaryrefslogtreecommitdiff
path: root/tests/test_stream_xep_0060.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-08-31 10:43:33 -0700
committerLance Stout <lancestout@gmail.com>2011-08-31 10:43:33 -0700
commit2500a0649ba10c0109a1ed021a051284c104391f (patch)
treebc7378a2b410a869afaa816701d2fcbd4f7ac160 /tests/test_stream_xep_0060.py
parent5ec4e4a026a5f3a3ec9c2cb6efd3dc1a4ccf580f (diff)
downloadslixmpp-2500a0649ba10c0109a1ed021a051284c104391f.tar.gz
slixmpp-2500a0649ba10c0109a1ed021a051284c104391f.tar.bz2
slixmpp-2500a0649ba10c0109a1ed021a051284c104391f.tar.xz
slixmpp-2500a0649ba10c0109a1ed021a051284c104391f.zip
Fix requesting pubsub node configuration, and add tests.
- <default /> doesn't have a type attribute in the XEP - <configure /> isn't used anymore for requesting default configuration
Diffstat (limited to 'tests/test_stream_xep_0060.py')
-rw-r--r--tests/test_stream_xep_0060.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/test_stream_xep_0060.py b/tests/test_stream_xep_0060.py
index 634bcd4a..15ed06ce 100644
--- a/tests/test_stream_xep_0060.py
+++ b/tests/test_stream_xep_0060.py
@@ -275,5 +275,49 @@ class TestStreamPubsub(SleekTest):
to="foo@comp.example.com/bar" from="pubsub.example.com" />
""")
+ def testGetDefaultConfig(self):
+ """Test retrieving the default node configuration."""
+ t = threading.Thread(name='default_config',
+ target=self.xmpp['xep_0060'].get_node_config,
+ args=('pubsub.example.com',))
+ t.start()
+
+ self.send("""
+ <iq type="get" id="1" to="pubsub.example.com">
+ <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
+ <default />
+ </pubsub>
+ </iq>
+ """, use_values=False)
+
+ self.recv("""
+ <iq type="result" id="1"
+ to="foo@comp.example.com/bar" from="pubsub.example.com" />
+ """)
+
+ t.join()
+
+ def testGetDefaultNodeConfig(self):
+ """Tes t retrieving the default config for a given node."""
+ t = threading.Thread(name='default_config',
+ target=self.xmpp['xep_0060'].get_node_config,
+ args=('pubsub.example.com', 'somenode'))
+ t.start()
+
+ self.send("""
+ <iq type="get" id="1" to="pubsub.example.com">
+ <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
+ <default node="somenode" />
+ </pubsub>
+ </iq>
+ """, use_values=False)
+
+ self.recv("""
+ <iq type="result" id="1"
+ to="foo@comp.example.com/bar" from="pubsub.example.com" />
+ """)
+
+ t.join()
+
suite = unittest.TestLoader().loadTestsFromTestCase(TestStreamPubsub)