summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrian Beggs <macdiesel@speakeasy.net>2010-05-14 10:59:41 -0400
committerBrian Beggs <macdiesel@speakeasy.net>2010-05-14 10:59:41 -0400
commit4b322720b39731d16fefedd8a77b3f9bb1684d7e (patch)
tree330e3a05f35675b0779060656156cefe320e27f2 /tests
parent1521a8b5c9d656ef80a4caf3d7daa86f8f504423 (diff)
parent7522839141e7dd5bd081a421a58b0962b705fdda (diff)
downloadslixmpp-4b322720b39731d16fefedd8a77b3f9bb1684d7e.tar.gz
slixmpp-4b322720b39731d16fefedd8a77b3f9bb1684d7e.tar.bz2
slixmpp-4b322720b39731d16fefedd8a77b3f9bb1684d7e.tar.xz
slixmpp-4b322720b39731d16fefedd8a77b3f9bb1684d7e.zip
Merge remote branch 'tom/master'
Diffstat (limited to 'tests')
-rw-r--r--tests/test_presencestanzas.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_presencestanzas.py b/tests/test_presencestanzas.py
index 430c71ca..23eb911e 100644
--- a/tests/test_presencestanzas.py
+++ b/tests/test_presencestanzas.py
@@ -11,5 +11,21 @@ class testpresencestanzas(unittest.TestCase):
p = self.p.Presence()
p['type'] = 'dnd'
self.failUnless(str(p) == "<presence><show>dnd</show></presence>")
+
+ def testPresenceUnsolicitedOffline(self):
+ "Unsolicted offline presence does not spawn changed_status or update roster"
+ p = self.p.Presence()
+ p['type'] = 'unavailable'
+ p['from'] = 'bill@chadmore.com/gmail15af'
+ import sleekxmpp
+ c = sleekxmpp.ClientXMPP('crap@wherever', 'password')
+ happened = []
+ def handlechangedpresence(event):
+ happened.append(True)
+ c.add_event_handler("changed_status", handlechangedpresence)
+ c._handlePresence(p)
+ self.failUnless(happened == [], "changed_status event triggered for superfulous unavailable presence")
+ self.failUnless(c.roster == {}, "Roster updated for superfulous unavailable presence")
+
suite = unittest.TestLoader().loadTestsFromTestCase(testpresencestanzas)