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_".
#
# 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
+@validates('R-52753')
def test_base_template_outputs_consumed(heat_templates):
'''
Check that all outputs in the base template is consumed
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-
+from .helpers import validates
import yaml
import pytest
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
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
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-
+from .helpers import validates
import pytest
import yaml
+@validates('R-88863')
def test_numeric_parameter(yaml_file):
'''
Make sure all numeric parameters has either `range` or `allowed_values`
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-
+from .helpers import validates
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
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-
+from .helpers import validates
import pytest
import yaml
assert not set(invalid_params)
+@validates('R-90526')
def test_default_values(yaml_file):
'''
Make sure no default values are set for any parameter.
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-
+from .helpers import validates
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
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-
+from .helpers import validates
import yaml
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
# 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
+@validates('R-70276')
def test_all_nested_templates_provided(yaml_files):
'''
Check that all templates marked as volume templates are
#
# 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.
#
from os import path
+from .helpers import validates
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
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-
import yaml
+from .helpers import validates
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
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-
+from .helpers import validates
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
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-
+from .helpers import validates
import yaml
import pytest
+@validates('R-97199')
def test_servers_metadata_use_get_param(yaml_file):
'''
Check all defined nova server instances include
#
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
-
+from .helpers import validates
import yaml
import collections
+@validates('R-16447')
def test_unique_resources_across_all_yaml_files(yaml_files):
'''
Check that all instance names are unique
#
# 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