[VVP] add decorators to test cases 53/56253/2
authorstark, steven <ss820f@att.com>
Wed, 11 Jul 2018 22:20:50 +0000 (15:20 -0700)
committerstark, steven <ss820f@att.com>
Wed, 11 Jul 2018 22:32:22 +0000 (15:32 -0700)
Adding initial set of decorators

Change-Id: I1d2064c94995fe30b607e7c7b8a0faebe7426f9b
Issue-ID: VVP-80
Signed-off-by: stark, steven <ss820f@att.com>
17 files changed:
ice_validator/tests/test_base_template_names.py
ice_validator/tests/test_base_template_outputs_consumed.py
ice_validator/tests/test_environment_file_structure.py
ice_validator/tests/test_get_file_only_reference_local_files.py
ice_validator/tests/test_heat_numeric_parameters.py
ice_validator/tests/test_heat_pairs_provided.py
ice_validator/tests/test_heat_parameter_section.py
ice_validator/tests/test_heat_template_parameters_contain_required_fields.py
ice_validator/tests/test_heat_template_structure.py
ice_validator/tests/test_nested_templates.py
ice_validator/tests/test_no_unused_parameters_between_env_and_templates.py
ice_validator/tests/test_parse_yaml.py
ice_validator/tests/test_referenced_and_defined_parameters_match.py
ice_validator/tests/test_resource_ids_alphanumeric_only.py
ice_validator/tests/test_servers_metadata_use_get_param.py
ice_validator/tests/test_unique_resources_across_all_templates.py
ice_validator/tests/test_volume_outputs_consumed.py

index d3fd7b4..27be5fc 100644 (file)
 from os import listdir
 from os import path
 from .helpers import check_basename_ending
 from os import listdir
 from os import path
 from .helpers import check_basename_ending
+from .helpers import validates
 
 
 
 
+@validates('R-37028', 'R-87485', 'R-81339', 'R-87247', 'R-76057')
 def test_base_template_names(template_dir):
     '''
     Check all base templates have a filename that includes "_base_".
 def test_base_template_names(template_dir):
     '''
     Check all base templates have a filename that includes "_base_".
index a0eb2ef..bec40f2 100644 (file)
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
+from .helpers import validates
 from os import path, sep
 import yaml
 import pytest
 
 
 from os import path, sep
 import yaml
 import pytest
 
 
+@validates('R-52753')
 def test_base_template_outputs_consumed(heat_templates):
     '''
     Check that all outputs in the base template is consumed
 def test_base_template_outputs_consumed(heat_templates):
     '''
     Check that all outputs in the base template is consumed
index d8cba6d..7213e3b 100644 (file)
@@ -37,7 +37,7 @@
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
+from .helpers import validates
 import yaml
 import pytest
 
 import yaml
 import pytest
 
@@ -54,6 +54,7 @@ def test_environment_structure(env_file):
     assert any(map(lambda v: v in yml, key_values))
 
 
     assert any(map(lambda v: v in yml, key_values))
 
 
+@validates('R-03324')
 def test_environment_file_contains_required_sections(env_file):
     '''
     Check that all environments files only have the allowed sections
 def test_environment_file_contains_required_sections(env_file):
     '''
     Check that all environments files only have the allowed sections
index 5282ee0..6588a61 100644 (file)
@@ -43,8 +43,10 @@ import pytest
 import re
 import yaml
 from .utils.nested_iterables import find_all_get_file_in_yml
 import re
 import yaml
 from .utils.nested_iterables import find_all_get_file_in_yml
+from .helpers import validates
 
 
 
 
+@validates('R-99646')
 def test_get_file_only_reference_local_files(yaml_file):
     '''
     Make sure that all references to get_file only try to access local files
 def test_get_file_only_reference_local_files(yaml_file):
     '''
     Make sure that all references to get_file only try to access local files
index e439015..ef29987 100644 (file)
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
+from .helpers import validates
 import pytest
 import yaml
 
 
 import pytest
 import yaml
 
 
+@validates('R-88863')
 def test_numeric_parameter(yaml_file):
     '''
     Make sure all numeric parameters has either `range` or `allowed_values`
 def test_numeric_parameter(yaml_file):
     '''
     Make sure all numeric parameters has either `range` or `allowed_values`
index 2f4b74a..c89917e 100644 (file)
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
+from .helpers import validates
 from os import path
 
 
 from os import path
 
 
+@validates('R-86285', 'R-38474', 'R-81725', 'R-53433', 'R-56438',
+           'R-74304', 'R-91342', 'R-94509', 'R-31141')
 def test_heat_pairs_provided(heat_templates, env_files, volume_templates):
     '''
     Check that every yaml file is submitted with
 def test_heat_pairs_provided(heat_templates, env_files, volume_templates):
     '''
     Check that every yaml file is submitted with
index c5d0b4c..e5792fc 100644 (file)
@@ -37,7 +37,7 @@
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
+from .helpers import validates
 import pytest
 import yaml
 
 import pytest
 import yaml
 
@@ -68,6 +68,7 @@ def test_parameter_valid_keys(yaml_file):
     assert not set(invalid_params)
 
 
     assert not set(invalid_params)
 
 
+@validates('R-90526')
 def test_default_values(yaml_file):
     '''
     Make sure no default values are set for any parameter.
 def test_default_values(yaml_file):
     '''
     Make sure no default values are set for any parameter.
index 1cfc4ce..31684a5 100644 (file)
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
+from .helpers import validates
 import yaml
 import pytest
 
 
 import yaml
 import pytest
 
 
+@validates('R-36772', 'R-44001')
 def test_heat_template_parameters_contain_required_fields(yaml_file):
     '''
     Check that all parameters in the environment
 def test_heat_template_parameters_contain_required_fields(yaml_file):
     '''
     Check that all parameters in the environment
index 3bbca31..0d8242e 100644 (file)
@@ -37,7 +37,7 @@
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
+from .helpers import validates
 import yaml
 
 
 import yaml
 
 
@@ -54,6 +54,7 @@ def test_heat_template_structure(yaml_file):
     assert any(map(lambda v: v in yml, key_values))
 
 
     assert any(map(lambda v: v in yml, key_values))
 
 
+@validates('27078', 'R-39402', 'R-35414')
 def test_heat_template_structure_contains_required_sections(yaml_file):
     '''
     Check that all heat templates have the required sections
 def test_heat_template_structure_contains_required_sections(yaml_file):
     '''
     Check that all heat templates have the required sections
index ce8785b..12f0f34 100644 (file)
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 
+from .helpers import validates
 import yaml
 from os import path
 from .utils.nested_files import get_list_of_nested_files
 
 
 import yaml
 from os import path
 from .utils.nested_files import get_list_of_nested_files
 
 
+@validates('R-70276')
 def test_all_nested_templates_provided(yaml_files):
     '''
     Check that all templates marked as volume templates are
 def test_all_nested_templates_provided(yaml_files):
     '''
     Check that all templates marked as volume templates are
index 03bae8f..f6ccd77 100644 (file)
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
+from .helpers import validates
 
 
 
 
+@validates('R-90279')
 def test_no_unused_parameters_between_env_and_templates(environment_pair):
     '''
     Check all defined parameters are used in the appropiate Heat template.
 def test_no_unused_parameters_between_env_and_templates(environment_pair):
     '''
     Check all defined parameters are used in the appropiate Heat template.
index 74bda27..5246f33 100644 (file)
 #
 
 from os import path
 #
 
 from os import path
+from .helpers import validates
 import pytest
 import yaml
 
 
 import pytest
 import yaml
 
 
+@validates('R-95303')
 def test_parse_yaml(filename):
     '''
     Read in each .yaml or .env file. If it is successfully parsed as yaml, save
 def test_parse_yaml(filename):
     '''
     Read in each .yaml or .env file. If it is successfully parsed as yaml, save
index 7622ba1..d31831f 100644 (file)
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
 import yaml
 import yaml
+from .helpers import validates
 from .utils.nested_iterables import find_all_get_param_in_yml
 
 
 from .utils.nested_iterables import find_all_get_param_in_yml
 
 
+@validates('R-23664')
 def test_referenced_and_defined_parameters_match(yaml_file):
     '''
     Check that all referenced parameters are actually defined
 def test_referenced_and_defined_parameters_match(yaml_file):
     '''
     Check that all referenced parameters are actually defined
index dc508ba..c124ea7 100644 (file)
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
+from .helpers import validates
 import yaml
 import pytest
 import re
 
 
 import yaml
 import pytest
 import re
 
 
+@validates('R-75141')
 def test_alphanumeric_resource_ids_only(yaml_file):
     '''
     Check that all instance names are only using alphanumerics
 def test_alphanumeric_resource_ids_only(yaml_file):
     '''
     Check that all instance names are only using alphanumerics
index a535544..c2d1d54 100644 (file)
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
+from .helpers import validates
 import yaml
 import pytest
 
 
 import yaml
 import pytest
 
 
+@validates('R-97199')
 def test_servers_metadata_use_get_param(yaml_file):
     '''
     Check all defined nova server instances include
 def test_servers_metadata_use_get_param(yaml_file):
     '''
     Check all defined nova server instances include
index 7682782..2d05147 100644 (file)
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
+from .helpers import validates
 import yaml
 import collections
 
 
 import yaml
 import collections
 
 
+@validates('R-16447')
 def test_unique_resources_across_all_yaml_files(yaml_files):
     '''
     Check that all instance names are unique
 def test_unique_resources_across_all_yaml_files(yaml_files):
     '''
     Check that all instance names are unique
index 771cfd6..648a689 100644 (file)
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
+from .helpers import validates
 
 
 
 
+@validates('R-11200', 'R-89913', 'R-07443')
 def test_volume_outputs_consumed(heat_volume_pair):
     '''
     Check that all outputs in a volume template is consumed
 def test_volume_outputs_consumed(heat_volume_pair):
     '''
     Check that all outputs in a volume template is consumed