diff --git a/claw/core/memory_mcp.py b/claw/core/memory_mcp.py index ae5abbb..07588c0 100644 --- a/claw/core/memory_mcp.py +++ b/claw/core/memory_mcp.py @@ -30,6 +30,7 @@ def _get_ws() -> WorkspaceClient: return WorkspaceClient( host=os.environ["DATABRICKS_HOST"], token=os.environ["DATABRICKS_TOKEN"], + auth_type="pat", ) diff --git a/tests/test_memory_mcp.py b/tests/test_memory_mcp.py index a520a8e..dde1904 100644 --- a/tests/test_memory_mcp.py +++ b/tests/test_memory_mcp.py @@ -9,6 +9,26 @@ from databricks.sdk.errors import NotFound +class TestGetWs: + """Unit tests for the _get_ws helper.""" + + @patch.dict("os.environ", { + "DATABRICKS_HOST": "https://test.cloud.databricks.com", + "DATABRICKS_TOKEN": "dapi-test-token", + }) + @patch("claw.core.memory_mcp.WorkspaceClient") + def test_passes_auth_type_pat(self, mock_ws_cls: MagicMock) -> None: + from claw.core.memory_mcp import _get_ws + + _get_ws() + + mock_ws_cls.assert_called_once_with( + host="https://test.cloud.databricks.com", + token="dapi-test-token", + auth_type="pat", + ) + + class TestReadMemoryTool: """Unit tests for the read_memory_tool function."""