[Asterisk-code-review] test config: Handle parsing of the global settings a bit better (testsuite[master])
Matt Jordan
asteriskteam at digium.com
Sat Oct 24 09:08:48 CDT 2015
Matt Jordan has uploaded a new change for review.
https://gerrit.asterisk.org/1519
Change subject: test_config: Handle parsing of the global settings a bit better
......................................................................
test_config: Handle parsing of the global settings a bit better
This patch merely does a bit of minor restructuring and cleanup of the code
responsible for determining the global settings block in the top most
test-config.yaml file.
Change-Id: I5438d115e38149f8e0dc38f2c74aa74b01d9d3c7
---
M lib/python/asterisk/test_config.py
1 file changed, 11 insertions(+), 12 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/19/1519/1
diff --git a/lib/python/asterisk/test_config.py b/lib/python/asterisk/test_config.py
index 3338833..b773726 100644
--- a/lib/python/asterisk/test_config.py
+++ b/lib/python/asterisk/test_config.py
@@ -265,7 +265,7 @@
self.excluded_tests = []
self.features = set()
self.feature_check = {}
- self.test_configuration = "(none)"
+ self.test_configuration = None
self.condition_definitions = []
self.global_test_config = global_test_config
@@ -291,18 +291,17 @@
if "global-settings" in self.config:
settings = self.config['global-settings']
- if "condition-definitions" in settings:
- self.condition_definitions = settings['condition-definitions']
- if "test-configuration" in settings:
- self.test_configuration = settings['test-configuration']
- if self.test_configuration in self.config:
- self.config = self.config[self.test_configuration]
+ self.condition_definitions = settings.get('condition-definitions', [])
+ self.test_configuration = settings.get('test-configuration')
- if self.config is not None and 'exclude-tests' in self.config:
- self.excluded_tests = self.config['exclude-tests']
- else:
- print ("WARNING - test configuration [%s] not found in "
- "config file" % self.test_configuration)
+ if self.test_configuration and self.test_configuration in self.config:
+ self.config = self.config[self.test_configuration]
+
+ if self.config is not None and 'exclude-tests' in self.config:
+ self.excluded_tests = self.config['exclude-tests']
+ else:
+ print ("WARNING - test configuration [%s] not found in "
+ "config file" % self.test_configuration)
def _process_testinfo(self):
"""Process the test information block"""
--
To view, visit https://gerrit.asterisk.org/1519
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5438d115e38149f8e0dc38f2c74aa74b01d9d3c7
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
More information about the asterisk-code-review
mailing list