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

Function TestApiCmd_FileAndOutputConflict

cmd/api/api_test.go:916–931  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

914}
915
916func 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
933func TestApiCmd_FileWithGET(t *testing.T) {
934 f, _, _, _ := cmdutil.TestFactory(t, &core.CliConfig{

Callers

nothing calls this directly

Calls 5

TestFactoryFunction · 0.92
NewCmdApiFunction · 0.85
apiRunFunction · 0.85
ContainsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected