summaryrefslogtreecommitdiff
path: root/tests/test_stream_roster.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-06-16 16:03:31 -0700
committerLance Stout <lancestout@gmail.com>2011-06-16 16:03:31 -0700
commit29d775e6756e7d8028438942ca2d34d1c39c559f (patch)
tree94d8b81a50d5f30eaa0e841ae9fa9b7d8f023626 /tests/test_stream_roster.py
parent251a47db8cd3262589ffdae5167dd5c4dee065a9 (diff)
downloadslixmpp-29d775e6756e7d8028438942ca2d34d1c39c559f.tar.gz
slixmpp-29d775e6756e7d8028438942ca2d34d1c39c559f.tar.bz2
slixmpp-29d775e6756e7d8028438942ca2d34d1c39c559f.tar.xz
slixmpp-29d775e6756e7d8028438942ca2d34d1c39c559f.zip
Integrate roster with BaseXMPP.
Last sent stanzas are saved regardless of if the roster is used directly or self.send_presence
Diffstat (limited to 'tests/test_stream_roster.py')
-rw-r--r--tests/test_stream_roster.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_stream_roster.py b/tests/test_stream_roster.py
index 69e5ca13..aa8fc26f 100644
--- a/tests/test_stream_roster.py
+++ b/tests/test_stream_roster.py
@@ -203,5 +203,35 @@ class TestStreamRoster(SleekTest):
self.failUnless(result == expected,
"Unexpected roster values: %s" % result)
+ def testSendLastPresence(self):
+ """Test that sending the last presence works."""
+ self.stream_start()
+ self.xmpp.send_presence(pshow='dnd')
+ self.xmpp.auto_authorize = True
+ self.xmpp.auto_subscribe = True
+
+ self.send("""
+ <presence>
+ <show>dnd</show>
+ </presence>
+ """)
+
+ self.recv("""
+ <presence from="user@localhost"
+ to="tester@localhost"
+ type="subscribe" />
+ """)
+
+ self.send("""
+ <presence to="user@localhost"
+ type="subscribed" />
+ """)
+
+ self.send("""
+ <presence to="user@localhost">
+ <show>dnd</show>
+ </presence>
+ """)
+
suite = unittest.TestLoader().loadTestsFromTestCase(TestStreamRoster)