aboutsummaryrefslogtreecommitdiffstats
path: root/ice_validator/tests
diff options
context:
space:
mode:
authorBozawglanian, Hagop (hb755d) <hb755d@att.com>2018-09-13 22:40:53 +0000
committerBozawglanian, Hagop (hb755d) <hb755d@att.com>2018-09-13 23:03:04 +0000
commit8de26dd1cc9ed33c3ab85a5014ac949f174db932 (patch)
tree3ec34d499b25046af15143c81fceb332e17e14e4 /ice_validator/tests
parent5cb6317e84178beb054230ae88d3af1a882920cf (diff)
VVP - Fixing script for traceability csv
Fixed the conftest.py script so traceability wouldn't have repeats and it pulls the newest JSON it runs. Issue-ID: VNFRQTS-236 Change-Id: Id33965b64f939bed0a6bbb7ab3a9e692829b4603 Signed-off-by: Bozawglanian, Hagop (hb755d) <hb755d@att.com>
Diffstat (limited to 'ice_validator/tests')
-rw-r--r--ice_validator/tests/conftest.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ice_validator/tests/conftest.py b/ice_validator/tests/conftest.py
index 598fc01..f5f25a3 100644
--- a/ice_validator/tests/conftest.py
+++ b/ice_validator/tests/conftest.py
@@ -44,6 +44,7 @@ import json
import os
import sys
import time
+import requests
import docutils.core
import pytest
@@ -532,6 +533,11 @@ def hash_directory(path):
def load_current_requirements():
"""Loads dict of current requirements or empty dict if file doesn't exist"""
+
+ url = 'https://onap.readthedocs.io/en/latest/_downloads/needs.json'
+ r = requests.get(url)
+ with open('requirements.json', 'wb') as needs:
+ needs.write(r.content)
path = "requirements.json"
if not os.path.exists(path):
return {}
@@ -570,7 +576,8 @@ def pytest_report_collectionfinish(config, startdir, items):
mapping_errors = set()
for item in mapped:
for req_id in item.function.requirement_ids:
- req_to_test[req_id].add(item)
+ if req_id not in req_to_test:
+ req_to_test[req_id].add(item)
if req_id not in requirements:
mapping_errors.add(
(req_id, item.function.__module__, item.function.__name__)