From 31d5da59b39d38760cc519a2c5e5b70357b539e8 Mon Sep 17 00:00:00 2001 From: "stark, steven" Date: Thu, 13 Sep 2018 16:49:43 -0700 Subject: [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 --- ice_validator/tests/structures.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'ice_validator/tests/structures.py') 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 + -- cgit 1.2.3-korg