Set public JCLComponent.send_error method
darcs-hash:20070222173205-86b55-d14f1d840e5ce83cd67a20afdbbc8d23b1907057.gz
This commit is contained in:
@@ -721,7 +721,7 @@ class JCLComponent(Component, object):
|
||||
(_account.name))
|
||||
self.stream.send(msg)
|
||||
|
||||
def _send_error(self, _account, exception):
|
||||
def send_error(self, _account, exception):
|
||||
"""Send an error message only one time until _account.in_error
|
||||
has been reset to False"""
|
||||
if _account.in_error == False:
|
||||
|
||||
@@ -1845,7 +1845,7 @@ class JCLComponent_TestCase(unittest.TestCase):
|
||||
name = "account11", \
|
||||
jid = "account11@jcl.test.com")
|
||||
exception = Exception("test exception")
|
||||
self.comp._send_error(_account, exception)
|
||||
self.comp.send_error(_account, exception)
|
||||
self.assertEqual(len(self.comp.stream.sent), 1)
|
||||
error_sent = self.comp.stream.sent[0]
|
||||
self.assertEqual(error_sent.get_to(), _account.user_jid)
|
||||
@@ -1865,5 +1865,5 @@ class JCLComponent_TestCase(unittest.TestCase):
|
||||
jid = "account11@jcl.test.com")
|
||||
_account.in_error = True
|
||||
exception = Exception("test exception")
|
||||
self.comp._send_error(_account, exception)
|
||||
self.comp.send_error(_account, exception)
|
||||
self.assertEqual(len(self.comp.stream.sent), 0)
|
||||
|
||||
Reference in New Issue
Block a user