Added support for testind disconnect errors.

This commit is contained in:
Lance Stout
2011-05-27 11:01:30 -07:00
parent ec9aed5b75
commit 384e1a92b7
5 changed files with 55 additions and 2 deletions

View File

@@ -58,6 +58,18 @@ class TestLiveSocket(object):
# ------------------------------------------------------------------
# Testing Interface
def disconnect_errror(self):
"""
Used to simulate a socket disconnection error.
Not used by live sockets.
"""
try:
self.socket.shutdown()
self.socket.close()
except:
pass
def next_sent(self, timeout=None):
"""
Get the next stanza that has been sent.