Merge "Remove unnecessary check for pytest.skip"
[vvp/validation-scripts.git] / ice_validator / tests / test_nova_server_resource_id.py
index 64462a5..d8d9754 100644 (file)
@@ -2,7 +2,7 @@
 # ============LICENSE_START====================================================
 # org.onap.vvp/validation-scripts
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright © 2019 AT&T Intellectual Property. All rights reserved.
 # ===================================================================
 #
 # Unless otherwise specified, all software contained herein is licensed
 #
 # ============LICENSE_END============================================
 #
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
 #
-
 """
 resources:
 {vm-type}_server_{vm-type_index}
 """
 import pytest
-
 from .structures import Heat
-from .structures import NovaServer
+from .structures import NovaServerProcessor
 from .helpers import validates
 
-VERSION = "1.0.0"
+VERSION = "2.0.0"
 
 # pylint: disable=invalid-name
 
 
 @validates("R-29751")
-def test_nova_server_resource_id(heat_template):
+def test_nova_server_resource_id(yaml_file):
     """
     A VNF's Heat Orchestration Template's Resource
     OS::Nova::Server Resource ID
@@ -63,16 +60,15 @@ def test_nova_server_resource_id(heat_template):
     * ``{vm-type}_server_{index}``
 
     """
-    heat = Heat(filepath=heat_template)
+    heat = Heat(filepath=yaml_file)
     resources = heat.nova_server_resources
     if not resources:
         pytest.skip("No Nova Server resources found")
-    nova_server = NovaServer()
     bad = []
     for rid in resources:
-        if not nova_server.get_rid_match_tuple(rid)[0]:
+        if not NovaServerProcessor.get_rid_match_tuple(rid)[0]:
             bad.append(rid)
     assert not bad, "Resource ids %s must match %s" % (
         bad,
-        nova_server.get_rid_patterns(),
+        NovaServerProcessor.get_rid_patterns(),
     )