MCPcopy
hub / github.com/larksuite/cli / TestPrintDryRun_JSON

Function TestPrintDryRun_JSON

internal/cmdutil/dryrun_test.go:124–141  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func TestPrintDryRun_JSON(t *testing.T) {
125 var buf bytes.Buffer
126 err := PrintDryRun(&buf, client.RawApiRequest{
127 Method: "GET",
128 URL: "/open-apis/test",
129 As: "user",
130 }, &core.CliConfig{AppID: "app123"}, "json")
131 if err != nil {
132 t.Fatalf("PrintDryRun failed: %v", err)
133 }
134 out := buf.String()
135 if !strings.Contains(out, "=== Dry Run ===") {
136 t.Errorf("expected header, got: %s", out)
137 }
138 if !strings.Contains(out, "app123") {
139 t.Errorf("expected appId in output, got: %s", out)
140 }
141}
142
143func TestPrintDryRun_Pretty(t *testing.T) {
144 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 3

PrintDryRunFunction · 0.85
StringMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected