diff options
author | Tom Nichols <tmnichols@gmail.com> | 2010-05-13 13:48:27 -0400 |
---|---|---|
committer | Tom Nichols <tmnichols@gmail.com> | 2010-05-13 13:48:27 -0400 |
commit | 341c110b6ad0922cb47494e493fe8075e00cad65 (patch) | |
tree | 7d07a4166213ee1e8d067d6daee0185b96533005 /tests/test_presencestanzas.py | |
parent | a92075a659866f611e7eefca6bf92b56272e48bd (diff) | |
parent | 7522839141e7dd5bd081a421a58b0962b705fdda (diff) | |
download | slixmpp-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.py | 16 |
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) |