diff options
author | Lance Stout <lancestout@gmail.com> | 2011-09-01 11:19:25 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-09-01 11:19:25 -0700 |
commit | ec01e45ed1f811a88c39f17f92a30f2f225a6ebc (patch) | |
tree | 4f2bb8c93b0a400fbcb35d280dee26f2908c88da /tests/test_stream_xep_0060.py | |
parent | 993829b23f923bc76aa0680977b34995105752ae (diff) | |
download | slixmpp-ec01e45ed1f811a88c39f17f92a30f2f225a6ebc.tar.gz slixmpp-ec01e45ed1f811a88c39f17f92a30f2f225a6ebc.tar.bz2 slixmpp-ec01e45ed1f811a88c39f17f92a30f2f225a6ebc.tar.xz slixmpp-ec01e45ed1f811a88c39f17f92a30f2f225a6ebc.zip |
Add ability for a user to get retrieve subscriptions, with tests.
Diffstat (limited to 'tests/test_stream_xep_0060.py')
-rw-r--r-- | tests/test_stream_xep_0060.py | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/test_stream_xep_0060.py b/tests/test_stream_xep_0060.py index 9ba01468..1ace0f96 100644 --- a/tests/test_stream_xep_0060.py +++ b/tests/test_stream_xep_0060.py @@ -626,7 +626,7 @@ class TestStreamPubsub(SleekTest): """) def testGetNodeSubscriptions(self): - """Test retrieving the subscriptions for a node.""" + """Test retrieving all subscriptions for a node.""" self.xmpp['xep_0060'].get_node_subscriptions( 'pubsub.example.com', 'somenode', @@ -639,4 +639,32 @@ class TestStreamPubsub(SleekTest): </iq> """) + def testGetSubscriptions(self): + """Test retrieving a users's subscriptions.""" + self.xmpp['xep_0060'].get_subscriptions( + 'pubsub.example.com', + block=False) + self.send(""" + <iq type="get" id="1" to="pubsub.example.com"> + <pubsub xmlns="http://jabber.org/protocol/pubsub"> + <subscriptions /> + </pubsub> + </iq> + """) + + def testGetSubscriptionsForNode(self): + """Test retrieving a users's subscriptions for a given node.""" + self.xmpp['xep_0060'].get_subscriptions( + 'pubsub.example.com', + node='somenode', + block=False) + self.send(""" + <iq type="get" id="1" to="pubsub.example.com"> + <pubsub xmlns="http://jabber.org/protocol/pubsub"> + <subscriptions node="somenode" /> + </pubsub> + </iq> + """) + + suite = unittest.TestLoader().loadTestsFromTestCase(TestStreamPubsub) |