[asterisk-commits] mjordan: testsuite/asterisk/trunk r3853 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 14 06:29:03 CDT 2013


Author: mjordan
Date: Fri Jun 14 06:29:01 2013
New Revision: 3853

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3853
Log:
Allow a SimpleTestCase object to specify a location for config files

This allows a group of tests to specify a shared common repository for
config files to use. This is of particular use for classes of tests that
need the same configuration. Note that this path is used in addition to
the normal location for configuration files, and supplements whatever is
in that location.

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=3853&r1=3852&r2=3853
==============================================================================
--- asterisk/trunk/lib/python/asterisk/SimpleTestCase.py (original)
+++ asterisk/trunk/lib/python/asterisk/SimpleTestCase.py Fri Jun 14 06:29:01 2013
@@ -35,7 +35,6 @@
         test_config Optional yaml loaded object containing config information
         '''
         TestCase.__init__(self, test_path, test_config=test_config)
-        self.create_asterisk()
 
         self._test_runs = []
         self._current_run = 0
@@ -44,6 +43,7 @@
         self._tracking_channels = []
         self._ignore_originate_failures = False
         self._spawn_after_hangup = False
+        self._config_path = None
 
         if test_config is None or 'test-iterations' not in test_config:
             # No special test configuration defined, use defaults
@@ -62,7 +62,9 @@
                 self._ignore_originate_failures = test_config['ignore-originate-failures']
             if 'spawn-after-hangup' in test_config:
                 self._spawn_after_hangup = test_config['spawn-after-hangup']
-
+            if 'config-path' in test_config:
+                self._config_path = test_config['config-path']
+        self.create_asterisk(count=1, base_configs_path=self._config_path)
 
     def ami_connect(self, ami):
         ''' AMI connect handler '''




More information about the asterisk-commits mailing list