aboutsummaryrefslogtreecommitdiffstats
path: root/ice_validator/tests/test_vm_type_syntax.py
diff options
context:
space:
mode:
authorstark, steven <steven.stark@att.com>2018-12-17 12:43:02 -0800
committerstark, steven <steven.stark@att.com>2018-12-17 13:04:00 -0800
commit1f4df7c7ad27b23773ad9cdbe4db1632ce388cf1 (patch)
tree8092104f8be23051ff81c9f71ee34116df4d33ba /ice_validator/tests/test_vm_type_syntax.py
parentca9085f0f77d442d3741a8c754e65cc45b6a318d (diff)
[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 <steven.stark@att.com>
Diffstat (limited to 'ice_validator/tests/test_vm_type_syntax.py')
-rw-r--r--ice_validator/tests/test_vm_type_syntax.py22
1 files changed, 10 insertions, 12 deletions
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