测试搜索插件市场
(self, test_client, auth_headers)
| 145 | class 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): |
nothing calls this directly
no test coverage detected