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

Function TestDryRunAPI_ExtraFieldsOnly

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

Source from the content-addressed store, hash-verified

107}
108
109func TestDryRunAPI_ExtraFieldsOnly(t *testing.T) {
110 dr := NewDryRunAPI().
111 Desc("info only").
112 Set("calendar_id", "cal_123").
113 Set("summary", "My Calendar")
114
115 text := dr.Format()
116 if !strings.Contains(text, "calendar_id: cal_123") {
117 t.Errorf("expected extra field, got: %s", text)
118 }
119 if !strings.Contains(text, "summary: My Calendar") {
120 t.Errorf("expected extra field, got: %s", text)
121 }
122}
123
124func TestPrintDryRun_JSON(t *testing.T) {
125 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 5

NewDryRunAPIFunction · 0.85
DescMethod · 0.80
FormatMethod · 0.80
SetMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected