[asterisk-commits] pabelanger: testsuite/asterisk/trunk r2120 - /asterisk/trunk/lib/python/aster...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 9 08:36:16 CDT 2011


Author: pabelanger
Date: Fri Sep  9 08:36:12 2011
New Revision: 2120

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2120
Log:
New wrapper function so we know when a reactor_timeout is called.

Modified:
    asterisk/trunk/lib/python/asterisk/TestCase.py

Modified: asterisk/trunk/lib/python/asterisk/TestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/TestCase.py?view=diff&rev=2120&r1=2119&r2=2120
==============================================================================
--- asterisk/trunk/lib/python/asterisk/TestCase.py (original)
+++ asterisk/trunk/lib/python/asterisk/TestCase.py Fri Sep  9 08:36:12 2011
@@ -114,12 +114,20 @@
         if reactor.running:
             reactor.stop()
 
+    def __reactor_timeout(self):
+        '''
+        A wrapper function for stop_reactor(), so we know when a reactor timeout
+        has occurred.
+        '''
+        logger.warning("Reactor timeout: '%s' seconds" % self.reactor_timeout)
+        self.stop_reactor()
+
     def run(self):
         """
 
         """
         if (self.reactor_timeout > 0):
-            reactor.callLater(self.reactor_timeout, self.stop_reactor)
+            reactor.callLater(self.reactor_timeout, self.__reactor_timeout)
 
     def ami_login_error(self, ami):
         logger.error("Error logging into AMI")




More information about the asterisk-commits mailing list