From f8b2ddabf17022661418ca3ec7d22dab51b3aa51 Mon Sep 17 00:00:00 2001 From: Cheikh Gueye Wane Date: Tue, 25 Jun 2024 15:28:48 +0000 Subject: [PATCH] fix(Connections): specify connection workspace (#170) --- openhexa/sdk/workspaces/current_workspace.py | 6 +++--- tests/test_workspace.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openhexa/sdk/workspaces/current_workspace.py b/openhexa/sdk/workspaces/current_workspace.py index db73fc2..90b0e9d 100644 --- a/openhexa/sdk/workspaces/current_workspace.py +++ b/openhexa/sdk/workspaces/current_workspace.py @@ -186,8 +186,8 @@ def get_connection( if self._connected: response = graphql( """ - query getConnection($slug: String!) { - connectionBySlug(slug: $slug) { + query getConnection($workspaceSlug:String!, $connectionSlug: String!) { + connectionBySlug(workspaceSlug:$workspaceSlug, connectionSlug: $connectionSlug) { type fields { code @@ -196,7 +196,7 @@ def get_connection( } } """, - {"slug": identifier}, + {"workspaceSlug": self.slug, "connectionSlug": identifier}, ) data = response["connectionBySlug"] if data is None: diff --git a/tests/test_workspace.py b/tests/test_workspace.py index afc8f8a..d948f82 100644 --- a/tests/test_workspace.py +++ b/tests/test_workspace.py @@ -269,6 +269,7 @@ def setup_method(self, monkeypatch): """Basics setup for the TestConnectedWorkspace.""" # Mock the class variable monkeypatch.setenv("HEXA_SERVER_URL", "http://app.openhexa.test") + monkeypatch.setenv("HEXA_WORKSPACE", "workspace") def test_workspace_files_path(self, monkeypatch, workspace): """Basic checks for the Workspace.files_path() method."""