MCPcopy Create free account
hub / github.com/openclaw/gogcli / TestExecute_GmailURL_JSON

Function TestExecute_GmailURL_JSON

internal/cmd/execute_gmail_test.go:54–71  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestExecute_GmailURL_JSON(t *testing.T) {
55 result := executeWithTestRuntime(t, []string{"--json", "--account", "a@b.com", "gmail", "url", "t1"}, nil)
56 if result.err != nil {
57 t.Fatalf("Execute: %v\nstderr=%q", result.err, result.stderr)
58 }
59 var parsed struct {
60 URLs []struct {
61 ID string `json:"id"`
62 URL string `json:"url"`
63 } `json:"urls"`
64 }
65 if err := json.Unmarshal([]byte(result.stdout), &parsed); err != nil {
66 t.Fatalf("json parse: %v\nout=%q", err, result.stdout)
67 }
68 if len(parsed.URLs) != 1 || parsed.URLs[0].ID != "t1" || !strings.Contains(parsed.URLs[0].URL, "#all/t1") {
69 t.Fatalf("unexpected urls: %#v", parsed.URLs)
70 }
71}

Callers

nothing calls this directly

Calls 1

executeWithTestRuntimeFunction · 0.85

Tested by

no test coverage detected