MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / TestGetContentType

Function TestGetContentType

plugins/destination/s3/client/spec/spec_test.go:102–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

100}
101
102func TestGetContentType(t *testing.T) {
103 cases := []struct {
104 Give Spec
105 ContentType string
106 }{
107 {Give: Spec{Path: "test/path", FileSpec: filetypes.FileSpec{Format: "json"}}, ContentType: "application/json"},
108 {Give: Spec{Path: "test/path", FileSpec: filetypes.FileSpec{Format: "csv"}}, ContentType: "text/csv"},
109 {Give: Spec{Path: "test/path", FileSpec: filetypes.FileSpec{Format: "parquet"}}, ContentType: "application/vnd.apache.parquet"},
110 {Give: Spec{Path: "test/path", FileSpec: filetypes.FileSpec{Format: "parquet", Compression: "gzip"}}, ContentType: "application/gzip"},
111 {Give: Spec{Path: "test/path", ContentType: "application/custom", FileSpec: filetypes.FileSpec{Format: "parquet", Compression: "gzip"}}, ContentType: "application/custom"},
112 }
113 for i, tc := range cases {
114 tc := tc
115 t.Run(fmt.Sprintf("Case %d", i+1), func(t *testing.T) {
116 require.Equal(t, tc.ContentType, tc.Give.GetContentType())
117 })
118 }
119}

Callers

nothing calls this directly

Calls 2

RunMethod · 0.80
GetContentTypeMethod · 0.80

Tested by

no test coverage detected