[VVP] udpating scripts for casablanca 2
[vvp/validation-scripts.git] / ice_validator / tests / test_port_resource_ids.py
index a6f7093..076c479 100644 (file)
@@ -2,11 +2,11 @@
 # ============LICENSE_START=======================================================
 # org.onap.vvp/validation-scripts
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright © 2018 AT&T Intellectual Property. All rights reserved.
 # ===================================================================
 #
 # Unless otherwise specified, all software contained herein is licensed
-# under the Apache License, Version 2.0 (the “License”);
+# under the Apache License, Version 2.0 (the "License");
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -21,7 +21,7 @@
 #
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# under the Creative Commons License, Attribution 4.0 Intl. (the "License");
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
 #
 
 import re
+
 import pytest
-import yaml
+from tests import cached_yaml as yaml
+
 from .helpers import validates
+from .utils.network_roles import get_network_role_from_port, \
+    get_network_type_from_port, \
+    property_uses_get_resource
 from .utils.vm_types import get_vm_type_for_nova_server
-from .utils.network_roles import get_network_role_from_port,\
-                                 get_network_type_from_port,\
-                                 property_uses_get_resource
 
 
-@validates('R-29865',
-           'R-69014',
+@validates('R-69014',
            'R-05201',
            'R-68936',
            'R-32025',
@@ -73,10 +74,8 @@ def test_port_resource_ids(heat_template):
     if "resources" not in yml:
         pytest.skip("No resources specified in the heat template")
 
-    port_patterns = {
-                    'internal': re.compile(r'(.+?)_\d+_int_(.+?)_port_\d+'),
-                    'external': re.compile(r'(.+?)_\d+_(.+?)_port_\d+'),
-                    }
+    port_patterns = {'internal': re.compile(r'(.+?)_\d+_int_(.+?)_port_\d+'),
+                     'external': re.compile(r'(.+?)_\d+_(.+?)_port_\d+')}
     resources = yml['resources']
 
     invalid_ports = []
@@ -121,7 +120,7 @@ def test_port_resource_ids(heat_template):
                 else:
                     continue
 
-                has_vm_type = vm_type+"_" in port_id
+                has_vm_type = vm_type + "_" in port_id
                 has_network_role = False
 
                 if port_resource: