diff --git a/ingestion/tests/unit/workflow_test.py b/ingestion/tests/unit/workflow_test.py index 18345133661..61e2c0c4be4 100644 --- a/ingestion/tests/unit/workflow_test.py +++ b/ingestion/tests/unit/workflow_test.py @@ -2,7 +2,7 @@ import importlib import pathlib from unittest import TestCase -from metadata.config.common import load_config_file +from metadata.config.common import load_config_file, ConfigurationError from metadata.ingestion.api.workflow import Workflow from metadata.ingestion.ometa.ometa_api import OpenMetadata from metadata.ingestion.ometa.openmetadata_rest import MetadataServerConfig @@ -49,7 +49,8 @@ class WorkflowTest(TestCase): self.assertEqual(replace, "QueryParser") def test_execute_200(self): - config_file = pathlib.Path("tests/unit/mysql_test.json") + current_dir = pathlib.Path(__file__).resolve().parent + config_file = current_dir.joinpath("mysql_test.json") workflow_config = load_config_file(config_file) workflow = Workflow.create(workflow_config) workflow.execute() @@ -69,12 +70,8 @@ class WorkflowTest(TestCase): self.assertEqual(ingestionData is not None, True) def test_execute_4xx(self): - config_file = pathlib.Path("tests/unit/mysql_test.json") - workflow_config = load_config_file(config_file) - ingestionData = None + config_file = pathlib.Path("/tmp/mysql_test123") try: - file_path = "/tmp/mysql_test123" - with open(file_path) as ingestionFile: - ingestionData = ingestionFile.read() - except FileNotFoundError: - self.assertRaises(FileNotFoundError) + workflow_config = load_config_file(config_file) + except ConfigurationError: + self.assertRaises(ConfigurationError)