(t *testing.T)
| 914 | } |
| 915 | |
| 916 | func TestApiCmd_FileAndOutputConflict(t *testing.T) { |
| 917 | f, _, _, _ := cmdutil.TestFactory(t, &core.CliConfig{ |
| 918 | AppID: "test-app", AppSecret: "test-secret", Brand: core.BrandFeishu, |
| 919 | }) |
| 920 | cmd := NewCmdApi(f, func(opts *APIOptions) error { |
| 921 | return apiRun(opts) |
| 922 | }) |
| 923 | cmd.SetArgs([]string{"POST", "/open-apis/test", "--as", "bot", "--file", "photo.jpg", "--output", "out.json"}) |
| 924 | err := cmd.Execute() |
| 925 | if err == nil { |
| 926 | t.Fatal("expected error for --file with --output") |
| 927 | } |
| 928 | if !strings.Contains(err.Error(), "mutually exclusive") { |
| 929 | t.Errorf("expected mutual exclusion error, got: %v", err) |
| 930 | } |
| 931 | } |
| 932 | |
| 933 | func TestApiCmd_FileWithGET(t *testing.T) { |
| 934 | f, _, _, _ := cmdutil.TestFactory(t, &core.CliConfig{ |
nothing calls this directly
no test coverage detected