فهرست منبع

update test for changes in tools and client rest

Khanh Nguyen 5 ماه پیش
والد
کامیت
f99d4300af
2فایلهای تغییر یافته به همراه9 افزوده شده و 8 حذف شده
  1. 5 4
      tests/test_client_rest.py
  2. 4 4
      tests/test_tools.py

+ 5 - 4
tests/test_client_rest.py

@@ -159,14 +159,15 @@ class TestExecuteSuccess:
     ) -> None:
         mock_client, _ = mock_httpx_client
 
-        client.execute(HTTPMethod.DELETE, "/rest/tools/resource")
-
+        client.execute(HTTPMethod.DELETE, "/rest/tools/resource/10000", params={
+            "mandatoryParent": 10000,
+        })
         mock_client.delete.assert_called_once_with(
-            "https://api.example.com/rest/tools/resource",
+            "https://api.example.com/rest/tools/resource/10000",
             headers=client.headers,
+            params={"mandatoryParent": 10000},
         )
 
-
 class TestExecuteErrors:
     def test_execute_raises_on_server_http_error(
         self,

+ 4 - 4
tests/test_tools.py

@@ -75,8 +75,8 @@ class TestToolsMcpIntegration:
         }
         client_rest.execute.assert_called_once_with(
             method=HTTPMethod.DELETE,
-            endpoint="/rest/tools/resource",
-            json={"id": 1},
+            endpoint="/rest/tools/resource/1",
+            params={}
         )
     
     async def test_create_template(self, mcp_session: ClientSession, client_rest: MagicMock) -> None:
@@ -171,7 +171,7 @@ class TestToolsMcpIntegration:
                 "name": "test-category",
             },
         }
-        result = await call_tool(mcp_session, "createCategory", {"category": "Test Category"})
+        result = await call_tool(mcp_session, "createCategory", {"name": "Test Category"})
         assert result == {
             "code": "200",
             "data": {
@@ -182,7 +182,7 @@ class TestToolsMcpIntegration:
         client_rest.execute.assert_called_once_with(
             method=HTTPMethod.POST,
             endpoint="/rest/tools/category",
-            json={"category": "Test Category"},
+            json={"name": "Test Category"},
         )
     
     async def test_update_category(self, mcp_session: ClientSession, client_rest: MagicMock) -> None: