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

Function TestIsJSONContentType

internal/client/client_test.go:71–89  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func TestIsJSONContentType(t *testing.T) {
72 tests := []struct {
73 ct string
74 want bool
75 }{
76 {"application/json", true},
77 {"application/json; charset=utf-8", true},
78 {"text/json", true},
79 {"application/octet-stream", false},
80 {"image/png", false},
81 {"text/html", false},
82 {"", false},
83 }
84 for _, tt := range tests {
85 if got := IsJSONContentType(tt.ct); got != tt.want {
86 t.Errorf("IsJSONContentType(%q) = %v, want %v", tt.ct, got, tt.want)
87 }
88 }
89}
90
91func TestMimeToExt(t *testing.T) {
92 tests := []struct {

Callers

nothing calls this directly

Calls 1

IsJSONContentTypeFunction · 0.85

Tested by

no test coverage detected