From 1f4df7c7ad27b23773ad9cdbe4db1632ce388cf1 Mon Sep 17 00:00:00 2001 From: "stark, steven" Date: Mon, 17 Dec 2018 12:43:02 -0800 Subject: [VVP] updating validation scripts in dublin - adding backlog of new validation scripts for dublin - updating existing tests - removing outdated tests Issue-ID: VVP-123 Change-Id: Ib8260889ac957c1dd28d8ede450fc8edc6fb0ec0 Signed-off-by: stark, steven --- ice_validator/tests/test_vm_type_syntax.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'ice_validator/tests/test_vm_type_syntax.py') diff --git a/ice_validator/tests/test_vm_type_syntax.py b/ice_validator/tests/test_vm_type_syntax.py index b2455c2..0a096b1 100644 --- a/ice_validator/tests/test_vm_type_syntax.py +++ b/ice_validator/tests/test_vm_type_syntax.py @@ -38,8 +38,8 @@ # ECOMP is a trademark and service mark of AT&T Intellectual Property. # -'''vm-type syntax -''' +"""vm-type syntax +""" import re @@ -49,27 +49,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') +@validates("R-98407") def test_vm_type_syntax(heat_template): - ''' + """ 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) 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 -- cgit 1.2.3-korg