MCPcopy
hub / github.com/lss233/kirara-ai / test_search_plugins

Method test_search_plugins

tests/web/api/plugin/test_plugin.py:147–162  ·  view source on GitHub ↗

测试搜索插件市场

(self, test_client, auth_headers)

Source from the content-addressed store, hash-verified

145class TestPlugin:
146 @pytest.mark.asyncio
147 async def test_search_plugins(self, test_client, auth_headers):
148 """测试搜索插件市场"""
149 with patch("aiohttp.ClientSession.get") as mock_get:
150 mock_response = MagicMock()
151 mock_response.status = 200
152 mock_response.json.return_value = MOCK_PLUGIN_SEARCH_RESPONSE()
153 mock_get.return_value.__aenter__.return_value = mock_response
154
155 response = test_client.get(
156 "/backend-api/api/plugin/v1/search?query=test&page=1&pageSize=10",
157 headers=auth_headers,
158 )
159
160 assert response.status_code == 200
161 data = response.json()
162 assert data == await MOCK_PLUGIN_SEARCH_RESPONSE()
163
164 @pytest.mark.asyncio
165 async def test_get_plugin_info(self, test_client, auth_headers):

Callers

nothing calls this directly

Calls 2

getMethod · 0.45

Tested by

no test coverage detected