diff options
author | Lance Stout <lancestout@gmail.com> | 2011-11-18 13:57:41 -0800 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-11-18 13:57:41 -0800 |
commit | d4c1ff53090abf1d0e672db3d26a9c88318c21ec (patch) | |
tree | 35f1b31f59e8a01e732b934ea918f55d949a24e8 /tests | |
parent | 22868c3924529701dd8d86ba32a7c1752a3f6cb5 (diff) | |
download | slixmpp-d4c1ff53090abf1d0e672db3d26a9c88318c21ec.tar.gz slixmpp-d4c1ff53090abf1d0e672db3d26a9c88318c21ec.tar.bz2 slixmpp-d4c1ff53090abf1d0e672db3d26a9c88318c21ec.tar.xz slixmpp-d4c1ff53090abf1d0e672db3d26a9c88318c21ec.zip |
Also fire changed_status when the status text changes for a resource.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_stream_presence.py | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/tests/test_stream_presence.py b/tests/test_stream_presence.py index b7e6229c..63ccb043 100644 --- a/tests/test_stream_presence.py +++ b/tests/test_stream_presence.py @@ -337,13 +337,44 @@ class TestStreamPresence(SleekTest): <presence from="user@example.com" to="tester@localhost" /> """) + self.recv(""" + <presence from="user@example.com" to="tester@localhost" /> + """) + + # Changed status text, so fire new event + self.recv(""" + <presence from="user@example.com" to="tester@localhost"> + <status>Testing!</status> + </presence> + """) + + # No change in show/status values, no event + self.recv(""" + <presence from="user@example.com" to="tester@localhost"> + <status>Testing!</status> + </presence> + """) + + self.recv(""" + <presence from="user@example.com" to="tester@localhost"> + <show>dnd</show> + <status>Testing!</status> + </presence> + """) + + self.recv(""" + <presence from="user@example.com" to="tester@localhost"> + <show>dnd</show> + <status>Testing!</status> + </presence> + """) time.sleep(0.3) self.assertEqual(events, ['available', 'away', 'dnd', 'chat', - 'xa', 'unavailable', 'available'], + 'xa', 'unavailable', 'available', + 'available', 'dnd'], "Changed status events incorrect: %s" % events) - suite = unittest.TestLoader().loadTestsFromTestCase(TestStreamPresence) |