(t *testing.T)
| 948 | } |
| 949 | |
| 950 | func TestApiCmd_FileStdinConflictWithData(t *testing.T) { |
| 951 | f, _, _, _ := cmdutil.TestFactory(t, &core.CliConfig{ |
| 952 | AppID: "test-app", AppSecret: "test-secret", Brand: core.BrandFeishu, |
| 953 | }) |
| 954 | cmd := NewCmdApi(f, func(opts *APIOptions) error { |
| 955 | return apiRun(opts) |
| 956 | }) |
| 957 | cmd.SetArgs([]string{"POST", "/open-apis/test", "--as", "bot", "--file", "-", "--data", "-"}) |
| 958 | err := cmd.Execute() |
| 959 | if err == nil { |
| 960 | t.Fatal("expected error for --file stdin with --data stdin") |
| 961 | } |
| 962 | if !strings.Contains(err.Error(), "cannot both read from stdin") { |
| 963 | t.Errorf("expected stdin conflict error, got: %v", err) |
| 964 | } |
| 965 | } |
| 966 | |
| 967 | func TestApiCmd_DryRunWithFile(t *testing.T) { |
| 968 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected