summaryrefslogtreecommitdiff
path: root/tests/test_presencestanzas.py
diff options
context:
space:
mode:
authorTom Nichols <tmnichols@gmail.com>2010-05-13 13:48:27 -0400
committerTom Nichols <tmnichols@gmail.com>2010-05-13 13:48:27 -0400
commit341c110b6ad0922cb47494e493fe8075e00cad65 (patch)
tree7d07a4166213ee1e8d067d6daee0185b96533005 /tests/test_presencestanzas.py
parenta92075a659866f611e7eefca6bf92b56272e48bd (diff)
parent7522839141e7dd5bd081a421a58b0962b705fdda (diff)
downloadslixmpp-341c110b6ad0922cb47494e493fe8075e00cad65.tar.gz
slixmpp-341c110b6ad0922cb47494e493fe8075e00cad65.tar.bz2
slixmpp-341c110b6ad0922cb47494e493fe8075e00cad65.tar.xz
slixmpp-341c110b6ad0922cb47494e493fe8075e00cad65.zip
Merge branch 'master' of git@github.com:tomstrummer/SleekXMPP into hacks
Diffstat (limited to 'tests/test_presencestanzas.py')
-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)