(t *testing.T)
| 122 | } |
| 123 | |
| 124 | func 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 | |
| 143 | func TestPrintDryRun_Pretty(t *testing.T) { |
| 144 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected