From 7b31d5ab3c3f51f98d66aabf5a41e948ed048f37 Mon Sep 17 00:00:00 2001 From: sahilkoli Date: Tue, 19 Jul 2022 16:55:49 +0530 Subject: [PATCH] Failure of Sonar job SMO-74 Signed-off-by: sahilkoli Change-Id: I89c8c16330b3c54e0c991cbe6903636a7ad7770b Signed-off-by: sahilkoli --- tests/collector/__init__.py | 9 ++++----- tests/collector/test_monitor.py | 5 ++--- tests/dmaap_adaptor/__init__.py | 3 +-- tests/dmaap_adaptor/test_appConfig.py | 3 +-- tests/influxdb_connector/__init__.py | 3 +-- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tests/collector/__init__.py b/tests/collector/__init__.py index 571a0b4..2570bf5 100755 --- a/tests/collector/__init__.py +++ b/tests/collector/__init__.py @@ -44,10 +44,9 @@ import sys import configparser PROJECT_PATH = os.getcwd() -configfile_name = PROJECT_PATH+'ves/tests/test_collector/test_collector.conf' -PROJECT_PATH = PROJECT_PATH[:PROJECT_PATH.rfind('/')] +configfile_name = PROJECT_PATH+'tests/test_collector/test_collector.conf' schema_file_path = os.path.join( - PROJECT_PATH,"ves/collector/evel-test-collector/docs/att_interface_definition/CommonEventFormat-v7-2-2.json") + PROJECT_PATH,"collector/evel-test-collector/docs/att_interface_definition/CommonEventFormat-v7-2-2.json") if os.path.isfile(configfile_name): # Create the configuration file as it doesn't exist yet cfgfile = open(configfile_name, "w") @@ -70,6 +69,6 @@ if os.path.isfile(configfile_name): Config.write(cfgfile) cfgfile.close() SOURCE_PATH = os.path.join( - PROJECT_PATH,"ves/collector/evel-test-collector/code/collector") -print(SOURCE_PATH, PROJECT_PATH,schema_file_path) + PROJECT_PATH,"collector/evel-test-collector/code/collector") +print(SOURCE_PATH, PROJECT_PATH,schema_file_path, configfile_name ) sys.path.append(SOURCE_PATH) diff --git a/tests/collector/test_monitor.py b/tests/collector/test_monitor.py index 953af13..e6ff8c5 100644 --- a/tests/collector/test_monitor.py +++ b/tests/collector/test_monitor.py @@ -34,19 +34,18 @@ from kafka import KafkaProducer def get_path(): project_path = os.getcwd() - project_path = project_path[:project_path.rfind('/')] return project_path def get_config_path(): project_path=get_path() config_path = os.path.join( - project_path,"ves/tests/collector/test_collector.conf") + project_path,"tests/collector/test_collector.conf") return config_path def get_schema_path(): project_path=get_path() schema_path = os.path.join( - project_path,"ves/collector/evel-test-collector/docs/att_interface_definition/CommonEventFormat-v7-2-2.json") + project_path,"collector/evel-test-collector/docs/att_interface_definition/CommonEventFormat-v7-2-2.json") return schema_path @pytest.fixture diff --git a/tests/dmaap_adaptor/__init__.py b/tests/dmaap_adaptor/__init__.py index 6029002..ebb6f30 100644 --- a/tests/dmaap_adaptor/__init__.py +++ b/tests/dmaap_adaptor/__init__.py @@ -17,8 +17,7 @@ import os import sys PROJECT_PATH = os.getcwd() -PROJECT_PATH = PROJECT_PATH[:PROJECT_PATH.rfind('/')] SOURCE_PATH = os.path.join( - PROJECT_PATH,"ves/dmaapadapter/adapter/code" + PROJECT_PATH,"dmaapadapter/adapter/code" ) sys.path.append(SOURCE_PATH) \ No newline at end of file diff --git a/tests/dmaap_adaptor/test_appConfig.py b/tests/dmaap_adaptor/test_appConfig.py index e3cd1fa..c3deb11 100644 --- a/tests/dmaap_adaptor/test_appConfig.py +++ b/tests/dmaap_adaptor/test_appConfig.py @@ -27,13 +27,12 @@ import pytest def get_path(): project_path = os.getcwd() - project_path = project_path[:project_path.rfind('/')] return project_path def get_config_path(): project_path=get_path() config_path = os.path.join( - project_path,"ves/dmaapadapter/adapter/config/adapter.conf") + project_path,"dmaapadapter/adapter/config/adapter.conf") return config_path @pytest.fixture diff --git a/tests/influxdb_connector/__init__.py b/tests/influxdb_connector/__init__.py index cfff36f..fe8c9af 100644 --- a/tests/influxdb_connector/__init__.py +++ b/tests/influxdb_connector/__init__.py @@ -17,8 +17,7 @@ import os import sys PROJECT_PATH = os.getcwd() -PROJECT_PATH = PROJECT_PATH[:PROJECT_PATH.rfind('/')] SOURCE_PATH = os.path.join( - PROJECT_PATH,"ves/influxdb-connector/influxdb-connector/code" + PROJECT_PATH,"influxdb-connector/influxdb-connector/code" ) sys.path.append(SOURCE_PATH) \ No newline at end of file -- 2.16.6