[asterisk-commits] mjordan: testsuite/asterisk/trunk r3760 - in /asterisk/trunk: lib/python/aste...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat May 4 10:10:28 CDT 2013


Author: mjordan
Date: Sat May  4 10:10:23 2013
New Revision: 3760

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3760
Log:
Tweak up the dialplan test/SimpleTestCase

This patch does two things:
1. If expected events is 0, we don't register a handler for UserEvent
in SimpleTestCase. This prevents a situation where we may intercept
a UserEvent and process it when the config explicitly told us not to

2. Removes dialplan's run-test script, as we don't need it anymore!

Removed:
    asterisk/trunk/tests/dialplan/run-test
Modified:
    asterisk/trunk/lib/python/asterisk/SimpleTestCase.py

Modified: asterisk/trunk/lib/python/asterisk/SimpleTestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/SimpleTestCase.py?view=diff&rev=3760&r1=3759&r2=3760
==============================================================================
--- asterisk/trunk/lib/python/asterisk/SimpleTestCase.py (original)
+++ asterisk/trunk/lib/python/asterisk/SimpleTestCase.py Sat May  4 10:10:23 2013
@@ -67,7 +67,8 @@
     def ami_connect(self, ami):
         ''' AMI connect handler '''
 
-        ami.registerEvent('UserEvent', self.__event_cb)
+        if self.expected_events != 0:
+            ami.registerEvent('UserEvent', self.__event_cb)
         ami.registerEvent('Hangup', self.__hangup_cb)
         ami.registerEvent('VarSet', self.__varset_cb)
 




More information about the asterisk-commits mailing list