MCPcopy Create free account
hub / github.com/astercloud/aster / checkPythonAiohttp

Function checkPythonAiohttp

pkg/tools/bridge/ptc_integration_test.go:227–240  ·  view source on GitHub ↗

checkPythonAiohttp 检查 Python 和 aiohttp 是否可用

()

Source from the content-addressed store, hash-verified

225
226// checkPythonAiohttp 检查 Python 和 aiohttp 是否可用
227func checkPythonAiohttp() bool {
228 runtime := NewPythonRuntime(nil)
229 if !runtime.IsAvailable() {
230 return false
231 }
232
233 // 检查 aiohttp 是否安装
234 code := "import aiohttp"
235 ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
236 defer cancel()
237
238 result, err := runtime.Execute(ctx, code, map[string]any{})
239 return err == nil && result.Success
240}

Callers 1

TestPTCIntegrationFunction · 0.85

Calls 5

IsAvailableMethod · 0.95
ExecuteMethod · 0.95
NewPythonRuntimeFunction · 0.85
cancelFunction · 0.85
WithTimeoutMethod · 0.45

Tested by

no test coverage detected