summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-04-07 17:19:39 -0400
committerLance Stout <lancestout@gmail.com>2012-04-07 17:22:29 -0400
commit7734aee7ad43bddc8bd1701f2d2773c4bbba6933 (patch)
tree094bd9a6803a27966abe57c6c8a3b96b183559bf /tests
parent9f855b9679952ae28c01f3d1f53c978e20f4e833 (diff)
downloadslixmpp-7734aee7ad43bddc8bd1701f2d2773c4bbba6933.tar.gz
slixmpp-7734aee7ad43bddc8bd1701f2d2773c4bbba6933.tar.bz2
slixmpp-7734aee7ad43bddc8bd1701f2d2773c4bbba6933.tar.xz
slixmpp-7734aee7ad43bddc8bd1701f2d2773c4bbba6933.zip
Prevent roster_update from firing twice after retrieving the roster.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_stream_roster.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/test_stream_roster.py b/tests/test_stream_roster.py
index 2d0da173..652ea1ce 100644
--- a/tests/test_stream_roster.py
+++ b/tests/test_stream_roster.py
@@ -24,7 +24,11 @@ class TestStreamRoster(SleekTest):
def roster_received(iq):
events.append('roster_received')
+ def roster_update(iq):
+ events.append('roster_update')
+
self.xmpp.add_event_handler('roster_received', roster_received)
+ self.xmpp.add_event_handler('roster_update', roster_update)
# Since get_roster blocks, we need to run it in a thread.
t = threading.Thread(name='get_roster', target=self.xmpp.get_roster)
@@ -62,8 +66,8 @@ class TestStreamRoster(SleekTest):
# Give the event queue time to process.
time.sleep(.1)
- self.failUnless('roster_received' in events,
- "Roster received event not triggered: %s" % events)
+ self.failUnless(events == ['roster_received', 'roster_update'],
+ "Wrong roster events fired: %s" % events)
def testRosterSet(self):
"""Test handling pushed roster updates."""