aboutsummaryrefslogtreecommitdiffstats
path: root/ice_validator/tests/structures.py
diff options
context:
space:
mode:
authorstark, steven <ss820f@att.com>2018-09-13 16:49:43 -0700
committerstark, steven <ss820f@att.com>2018-09-13 17:21:45 -0700
commit31d5da59b39d38760cc519a2c5e5b70357b539e8 (patch)
tree7298d118aefb1e7494afa5cbedaa5e499b78373d /ice_validator/tests/structures.py
parent8de26dd1cc9ed33c3ab85a5014ac949f174db932 (diff)
[VVP] udpating scripts for casablanca
adding new "infrastructure" scripts addresses bugs VVP-100, VVP-101, VVP-102 adding base tests updating tests where arguments have changed Adds traceability for task VVP-92 Change-Id: I067d8e80934403039e66fbc9fc93766587f67b4e Issue-ID: VVP-80 Signed-off-by: stark, steven <ss820f@att.com>
Diffstat (limited to 'ice_validator/tests/structures.py')
-rw-r--r--ice_validator/tests/structures.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/ice_validator/tests/structures.py b/ice_validator/tests/structures.py
index d10c5ea..8d66220 100644
--- a/ice_validator/tests/structures.py
+++ b/ice_validator/tests/structures.py
@@ -38,16 +38,16 @@
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-"""structures
-"""
+'''structures
+'''
import os
-import yaml
+from tests import cached_yaml as yaml
from .utils import nested_dict
-VERSION = "1.4.0"
+VERSION = '1.4.0'
class Heat(object):
@@ -55,7 +55,6 @@ class Heat(object):
filepath - absolute path to template file.
envpath - absolute path to environmnt file.
"""
-
def __init__(self, filepath=None, envpath=None):
self.filepath = None
self.basename = None
@@ -82,13 +81,13 @@ class Heat(object):
self.dirname = os.path.dirname(self.filepath)
with open(self.filepath) as fi:
self.yml = yaml.load(fi)
- self.heat_template_version = self.yml.get("heat_template_version", None)
- self.description = self.yml.get("description", "")
- self.parameter_groups = self.yml.get("parameter_groups", {})
- self.parameters = self.yml.get("parameters", {})
- self.resources = self.yml.get("resources", {})
- self.outputs = self.yml.get("outputs", {})
- self.conditions = self.yml.get("conditions", {})
+ self.heat_template_version = self.yml.get('heat_template_version', None)
+ self.description = self.yml.get('description', '')
+ self.parameter_groups = self.yml.get('parameter_groups', {})
+ self.parameters = self.yml.get('parameters', {})
+ self.resources = self.yml.get('resources', {})
+ self.outputs = self.yml.get('outputs', {})
+ self.conditions = self.yml.get('conditions', {})
def load_env(self, envpath):
"""Load the Environment template given a envpath.
@@ -105,21 +104,22 @@ class Heat(object):
class Env(Heat):
"""An Environment file
"""
-
pass
class Resource(object):
"""A Resource
"""
-
def __init__(self, resource_id=None, resource=None):
- self.resource_id = resource_id or ""
+ self.resource_id = resource_id or ''
self.resource = resource or {}
@staticmethod
def get_index_var(resource):
"""Return the index_var for this resource.
"""
- index_var = nested_dict.get(resource, "properties", "index_var") or "index"
+ index_var = nested_dict.get(resource,
+ 'properties',
+ 'index_var') or 'index'
return index_var
+