[Asterisk-code-review] test case: Allow the test config for TestCaseModule to be empty (testsuite[master])

Anonymous Coward asteriskteam at digium.com
Sun Oct 25 09:35:17 CDT 2015


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: test_case: Allow the test config for TestCaseModule to be empty
......................................................................


test_case: Allow the test config for TestCaseModule to be empty

TestCaseModule does not require any configuration, although it is relatively
boring in that case. Either way, the constructor for the class should be
tolerant of an empty configuration object.

Change-Id: I646ed342a47343dfd6f07b5f8f56cd9fb8b10091
---
M lib/python/asterisk/test_case.py
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/lib/python/asterisk/test_case.py b/lib/python/asterisk/test_case.py
index 40f253e..6b76aaf 100644
--- a/lib/python/asterisk/test_case.py
+++ b/lib/python/asterisk/test_case.py
@@ -888,7 +888,11 @@
         :param test_path Full path to the test location
         :param test_config The YAML provided test configuration for this object
         """
+        if not test_config:
+            test_config = {}
+
         super(TestCaseModule, self).__init__(test_path, test_config)
+
         self.asterisk_instances = test_config.get('asterisk-instances') or 1
         self.connect_ami = test_config.get('connect-ami') or False
         self.connect_agi = test_config.get('connect-agi') or False

-- 
To view, visit https://gerrit.asterisk.org/1518
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I646ed342a47343dfd6f07b5f8f56cd9fb8b10091
Gerrit-PatchSet: 2
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list