aboutsummaryrefslogtreecommitdiffstats
path: root/ice_validator/tests/test_all_referenced_resources_exists.py
diff options
context:
space:
mode:
Diffstat (limited to 'ice_validator/tests/test_all_referenced_resources_exists.py')
-rw-r--r--ice_validator/tests/test_all_referenced_resources_exists.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/ice_validator/tests/test_all_referenced_resources_exists.py b/ice_validator/tests/test_all_referenced_resources_exists.py
index fd5b967..39247bf 100644
--- a/ice_validator/tests/test_all_referenced_resources_exists.py
+++ b/ice_validator/tests/test_all_referenced_resources_exists.py
@@ -1,12 +1,12 @@
# -*- coding: utf8 -*-
-# ============LICENSE_START=======================================================
+# ============LICENSE_START====================================================
# org.onap.vvp/validation-scripts
# ===================================================================
# Copyright © 2017 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
#
@@ -38,10 +38,18 @@
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
#
+'''test_all_referenced_resources_exists
+'''
+
import pytest
import yaml
+
from .utils.nested_iterables import find_all_get_resource_in_yml
+VERSION = '1.0.0'
+
+# pylint: disable=invalid-name
+
def test_all_referenced_resources_exists(yaml_file):
'''
@@ -58,9 +66,11 @@ def test_all_referenced_resources_exists(yaml_file):
resource_ids = yml['resources'].keys()
referenced_resource_ids = find_all_get_resource_in_yml(yml)
- missing_referenced_resources = []
+ missing_referenced_resources = set()
for referenced_resource_id in referenced_resource_ids:
if referenced_resource_id not in resource_ids:
- missing_referenced_resources.append(referenced_resource_id)
+ missing_referenced_resources.add(referenced_resource_id)
- assert not set(missing_referenced_resources)
+ assert not missing_referenced_resources, (
+ 'missing referenced resources %s' % list(
+ missing_referenced_resources))