Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions claw/core/memory_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def _get_ws() -> WorkspaceClient:
return WorkspaceClient(
host=os.environ["DATABRICKS_HOST"],
token=os.environ["DATABRICKS_TOKEN"],
auth_type="pat",
)


Expand Down
20 changes: 20 additions & 0 deletions tests/test_memory_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down
Loading