summaryrefslogtreecommitdiff
path: root/tests/test_stream_xep_0060.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_stream_xep_0060.py')
-rw-r--r--tests/test_stream_xep_0060.py30
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)