X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Ftest_vm_type_syntax.py;h=d6b14d1220e1f54bc3fbb9872f2ce91a3f577ca2;hb=00c64458942602efe5a3b712540b98ac94fb60f4;hp=b44118be61d77c96eedd3493fdebe817e27ac430;hpb=1af0d577ab6d8c431ae1322657c50efd5e0a1a93;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/test_vm_type_syntax.py b/ice_validator/tests/test_vm_type_syntax.py index b44118b..d6b14d1 100644 --- a/ice_validator/tests/test_vm_type_syntax.py +++ b/ice_validator/tests/test_vm_type_syntax.py @@ -35,11 +35,10 @@ # # ============LICENSE_END============================================ # -# ECOMP is a trademark and service mark of AT&T Intellectual Property. # -'''vm-type syntax -''' +"""vm-type syntax +""" import re @@ -49,26 +48,25 @@ from .structures import Heat from .helpers import validates from .utils import vm_types -VERSION = '1.0.0' +VERSION = "1.0.0" -RE_VM_TYPE = re.compile(r'[\w\d_]+$') -RE_VM_TYPE_NG = re.compile(r'.*_int|_?int_.*$') +RE_VM_TYPE = re.compile(r"[\w\d_]+$") +RE_VM_TYPE_NG = re.compile(r".*_int|_?int_.*$") -@validates('R-98407') -def test_vm_type_syntax(heat_template): - ''' +@validates("R-98407") +def test_vm_type_syntax(yaml_file): + """ A VNF's Heat Orchestration Template's ``{vm-type}`` **MUST** contain only alphanumeric characters and/or underscores '_' and **MUST NOT** contain any of the following strings: ``_int`` or ``int_`` or ``_int_``. - ''' - v = Heat(filepath=heat_template) + """ + v = Heat(filepath=yaml_file) if not v.resources: pytest.skip("No resources") t = set() - t.update(*[vm_types.get_vm_types_for_resource(r) - for r in v.resources.values()]) + t.update(*[vm_types.get_vm_types_for_resource(r) for r in v.resources.values()]) bad = [x for x in t if not RE_VM_TYPE.match(x) or RE_VM_TYPE_NG.match(x)] - assert not bad, 'bad vm-types %s' % bad + assert not bad, "bad vm-types %s" % bad