From 2500a0649ba10c0109a1ed021a051284c104391f Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 31 Aug 2011 10:43:33 -0700 Subject: Fix requesting pubsub node configuration, and add tests. - doesn't have a type attribute in the XEP - isn't used anymore for requesting default configuration --- tests/test_stanza_xep_0060.py | 3 +-- tests/test_stream_xep_0060.py | 44 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_stanza_xep_0060.py b/tests/test_stanza_xep_0060.py index 5d5c843a..34556608 100644 --- a/tests/test_stanza_xep_0060.py +++ b/tests/test_stanza_xep_0060.py @@ -148,14 +148,13 @@ class TestPubsubStanzas(SleekTest): iq = self.Iq() iq['pubsub_owner']['default'] iq['pubsub_owner']['default']['node'] = 'mynode' - iq['pubsub_owner']['default']['type'] = 'leaf' iq['pubsub_owner']['default']['form'].addField('pubsub#title', ftype='text-single', value='This thing is awesome') self.check(iq, """ - + This thing is awesome 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(""" + + + + + + """, use_values=False) + + self.recv(""" + + """) + + 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(""" + + + + + + """, use_values=False) + + self.recv(""" + + """) + + t.join() + suite = unittest.TestLoader().loadTestsFromTestCase(TestStreamPubsub) -- cgit v1.2.3