(t *testing.T)
| 275 | } |
| 276 | |
| 277 | func TestShareLinkRevokeJSONOutputsRevokedURL(t *testing.T) { |
| 278 | stubSharedLinkClient(t, &mockSharedLinkClient{ |
| 279 | revokeSharedLinkFn: func(arg *sharing.RevokeSharedLinkArg) error { |
| 280 | return nil |
| 281 | }, |
| 282 | }) |
| 283 | |
| 284 | var stdout bytes.Buffer |
| 285 | cmd := newShareLinkRevokeTestCommand(&stdout, nil) |
| 286 | setShareLinkOutputJSON(t, cmd) |
| 287 | |
| 288 | if err := shareLinkRevoke(cmd, []string{"https://example.com/report"}); err != nil { |
| 289 | t.Fatalf("shareLinkRevoke error: %v", err) |
| 290 | } |
| 291 | |
| 292 | got := decodeShareLinkOperationOutput[shareLinkRevokeInput, shareLinkRevokeResult](t, stdout.Bytes()) |
| 293 | if got.Input.URL != "https://example.com/report" { |
| 294 | t.Fatalf("input.url = %q, want revoked URL", got.Input.URL) |
| 295 | } |
| 296 | if len(got.Results) != 1 || got.Results[0].Status != shareLinkJSONStatusRevoked || got.Results[0].Kind != shareLinkJSONKindSharedLink || got.Results[0].Result.URL != "https://example.com/report" { |
| 297 | t.Fatalf("results = %#v, want revoked URL", got.Results) |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | func TestShareLinkDownloadJSONOutputsTargetAndMetadata(t *testing.T) { |
| 302 | tmp := t.TempDir() |
nothing calls this directly
no test coverage detected