跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

macos_claude_test.go

32 行 · 965 B历史下载
1package workbench
2
3import (
4 "net/http"
5 "net/http/httptest"
6 "strings"
7 "testing"
8
9 "github.com/sylvinus/agent-vm/internal/guestos"
10)
11
12func TestMacOSClaudeRouteCannotRequestProjectPanel(t *testing.T) {
13 s := testServer(t)
14 body := `{"action":"project-frame","project":"/Users/guest/Cage/Projects/aaaaaaaaaaaaaaaaaaaaaaaa"}`
15 // A project grant must be checked by the separate approval route.
16 for _, test := range []struct {
17 profile *guestos.MacOSProfile
18 status int
19 }{
20 {nil, http.StatusNotFound},
21 {&guestos.MacOSProfile{Instance: "mac", User: "guest"}, http.StatusBadRequest},
22 } {
23 s.macosGuest = test.profile
24 response := httptest.NewRecorder()
25 request := httptest.NewRequest(http.MethodPost, "/api/macos/claude/window", strings.NewReader(body))
26 request.Header.Set("Content-Type", "application/json")
27 s.macOSClaudeWindow(response, request)
28 if response.Code != test.status {
29 t.Fatalf("got %d, want %d", response.Code, test.status)
30 }
31 }
32}