aboutsummaryrefslogtreecommitdiffstats
path: root/ice_validator/tests/helpers.py
diff options
context:
space:
mode:
authorLovett, Trevor <trevor.lovett@att.com>2019-05-14 10:37:17 -0500
committerLovett, Trevor <trevor.lovett@att.com>2019-05-14 11:53:41 -0500
commit9ccbfe7e20b3914c37c0dec50762cec9da8a63c6 (patch)
treec8164726199ec286f7619fc23f4986311022dbe9 /ice_validator/tests/helpers.py
parent503041fb7ec395fe57e418d584c4a5d06f4c9877 (diff)
[VVP] Adding env file checks for contrail
* Introduced helper method get_param to handle extracting param names from both get_params with string and list arguments * Moved test files for environment tests to independent directories to make it easier to isolate unit tests * Added contrail tests related to env file usage related to VNFRQTS-630 Change-Id: I3b44f0ce2d5657e9ab5290cd77f1422b36052b6a Issue-ID: VVP-213 Signed-off-by: Lovett, Trevor <trevor.lovett@att.com>
Diffstat (limited to 'ice_validator/tests/helpers.py')
-rw-r--r--ice_validator/tests/helpers.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/ice_validator/tests/helpers.py b/ice_validator/tests/helpers.py
index c73a118..fd78c75 100644
--- a/ice_validator/tests/helpers.py
+++ b/ice_validator/tests/helpers.py
@@ -324,3 +324,17 @@ def prop_iterator(resource, *props):
yield from prop_iterator(x, *props)
elif isinstance(prop, dict):
yield from prop_iterator(prop, *props)
+
+
+def get_param(property_value):
+ """
+ Returns the first parameter name from a get_param or None if get_param is
+ not used
+ """
+ if property_value and isinstance(property_value, dict):
+ param = property_value.get("get_param")
+ if param and isinstance(param, list) and len(param) > 0:
+ return param[0]
+ else:
+ return param
+ return None