From 31c2ec8c57ed0ba15d35d7dba99bb73661edf265 Mon Sep 17 00:00:00 2001 From: Imri Paran Date: Tue, 20 Aug 2024 08:14:09 +0200 Subject: [PATCH] MINOR: fix qlikcloud test connection (#17459) * fix: qlikcloud test connection * patch test_connection for qlik cloud unit tests --- .../metadata/ingestion/source/dashboard/qlikcloud/client.py | 2 +- ingestion/tests/unit/topology/dashboard/test_qlikcloud.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/dashboard/qlikcloud/client.py b/ingestion/src/metadata/ingestion/source/dashboard/qlikcloud/client.py index f55435eec1b..307cc971f2f 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/qlikcloud/client.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/qlikcloud/client.py @@ -145,7 +145,7 @@ class QlikCloudClient: resp_apps = self.client.get("/v1/items?resourceType=app") if resp_apps: resp = QlikAppResponse(**resp_apps) - yield from resp.apps + return list(resp.apps) def get_dashboard_details(self, dashboard_id: str) -> Optional[QlikApp]: """ diff --git a/ingestion/tests/unit/topology/dashboard/test_qlikcloud.py b/ingestion/tests/unit/topology/dashboard/test_qlikcloud.py index ce9fe373e02..35a2ababc5e 100644 --- a/ingestion/tests/unit/topology/dashboard/test_qlikcloud.py +++ b/ingestion/tests/unit/topology/dashboard/test_qlikcloud.py @@ -157,7 +157,11 @@ class QlikCloudUnitTest(TestCase): """ def __init__(self, methodName) -> None: - with patch.object(QlikCloudClient, "get_dashboards_list", return_value=None): + with patch.object( + QlikCloudClient, "get_dashboards_list", return_value=None + ), patch.object( + QlikCloudClient, "get_dashboards_list_test_conn", return_value=None + ): super().__init__(methodName) # test_connection.return_value = False self.config = OpenMetadataWorkflowConfig.model_validate(