MCPcopy
hub / github.com/minio/minio-go / TestCORSXMLMarshal

Function TestCORSXMLMarshal

pkg/cors/cors_test.go:26–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24)
25
26func TestCORSXMLMarshal(t *testing.T) {
27 fileContents, err := os.ReadFile("testdata/example.xml")
28 if err != nil {
29 t.Fatal(err)
30 }
31 c, err := ParseBucketCorsConfig(bytes.NewReader(fileContents))
32 if err != nil {
33 t.Fatal(err)
34 }
35 remarshalled, err := c.ToXML()
36 if err != nil {
37 t.Fatal(err)
38 }
39 trimmedFileContents := bytes.TrimSpace(fileContents)
40 if !bytes.Equal(trimmedFileContents, remarshalled) {
41 t.Errorf("got: %s, want: %s", string(remarshalled), string(trimmedFileContents))
42 }
43}

Callers

nothing calls this directly

Calls 3

ParseBucketCorsConfigFunction · 0.85
ToXMLMethod · 0.80
EqualMethod · 0.80

Tested by

no test coverage detected