summaryrefslogtreecommitdiff
path: root/tests/test_stream_xep_0060.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-09-01 11:30:55 -0700
committerLance Stout <lancestout@gmail.com>2011-09-01 11:30:55 -0700
commitafbd506cfc5aea6e70edc5cb6584e9d36f539965 (patch)
tree7e6b782d26978c61910a00e080ccf42b2c15061a /tests/test_stream_xep_0060.py
parentec01e45ed1f811a88c39f17f92a30f2f225a6ebc (diff)
downloadslixmpp-afbd506cfc5aea6e70edc5cb6584e9d36f539965.tar.gz
slixmpp-afbd506cfc5aea6e70edc5cb6584e9d36f539965.tar.bz2
slixmpp-afbd506cfc5aea6e70edc5cb6584e9d36f539965.tar.xz
slixmpp-afbd506cfc5aea6e70edc5cb6584e9d36f539965.zip
Users can retrieve their affiliations now, with tests.
Diffstat (limited to 'tests/test_stream_xep_0060.py')
-rw-r--r--tests/test_stream_xep_0060.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_stream_xep_0060.py b/tests/test_stream_xep_0060.py
index 1ace0f96..b90359f9 100644
--- a/tests/test_stream_xep_0060.py
+++ b/tests/test_stream_xep_0060.py
@@ -666,5 +666,32 @@ class TestStreamPubsub(SleekTest):
</iq>
""")
+ def testGetAffiliations(self):
+ """Test retrieving a users's affiliations."""
+ self.xmpp['xep_0060'].get_affiliations(
+ 'pubsub.example.com',
+ block=False)
+ self.send("""
+ <iq type="get" id="1" to="pubsub.example.com">
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
+ <affiliations />
+ </pubsub>
+ </iq>
+ """)
+
+ def testGetAffiliatinssForNode(self):
+ """Test retrieving a users's affiliations for a given node."""
+ self.xmpp['xep_0060'].get_affiliations(
+ '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">
+ <affiliations node="somenode" />
+ </pubsub>
+ </iq>
+ """)
+
suite = unittest.TestLoader().loadTestsFromTestCase(TestStreamPubsub)