summaryrefslogtreecommitdiff
path: root/tests/test_stream_roster.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-05-31 12:48:43 -0700
committerLance Stout <lancestout@gmail.com>2011-06-01 15:17:22 -0700
commit8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d (patch)
treeed58dc66611c99710a404fe5795f9f3d4364f777 /tests/test_stream_roster.py
parent14693233504383d4df0ed092c870d5d7baea6538 (diff)
downloadslixmpp-8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d.tar.gz
slixmpp-8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d.tar.bz2
slixmpp-8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d.tar.xz
slixmpp-8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d.zip
Begin experimental use of exceptions.
Provides IqTimeout and IqError which are raised when an Iq response does not arrive in time, or it arrives with type='error'.
Diffstat (limited to 'tests/test_stream_roster.py')
-rw-r--r--tests/test_stream_roster.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/tests/test_stream_roster.py b/tests/test_stream_roster.py
index e1aa1766..95163744 100644
--- a/tests/test_stream_roster.py
+++ b/tests/test_stream_roster.py
@@ -111,19 +111,12 @@ class TestStreamRoster(SleekTest):
def testRosterTimeout(self):
"""Test handling a timed out roster request."""
self.stream_start()
- events = []
-
- def roster_timeout(event):
- events.append('roster_timeout')
-
- self.xmpp.add_event_handler('roster_timeout', roster_timeout)
- self.xmpp.get_roster(timeout=0)
- # Give the event queue time to process.
- time.sleep(.1)
+ def do_test():
+ self.xmpp.get_roster(timeout=0)
+ time.sleep(.1)
- self.failUnless(events == ['roster_timeout'],
- "Roster timeout event not triggered: %s." % events)
+ self.assertRaises(IqTimeout, do_test)
def testRosterCallback(self):
"""Test handling a roster request callback."""