MCPcopy Create free account
hub / github.com/aws/smithy-go / TestEncoderHasHeader

Function TestEncoderHasHeader

encoding/httpbinding/encode_test.go:66–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestEncoderHasHeader(t *testing.T) {
67 encoder, err := NewEncoder("/", "", http.Header{})
68 if err != nil {
69 t.Fatalf("expected no error, got %v", err)
70 }
71
72 if h := "i-dont-exist"; encoder.HasHeader(h) {
73 t.Errorf("expect %v not to be set", h)
74 }
75
76 encoder.AddHeader("I-do-exist").String("some value")
77
78 if h := "I-do-exist"; !encoder.HasHeader(h) {
79 t.Errorf("expect %v to be set", h)
80 }
81
82}
83
84func TestEncoderHasQuery(t *testing.T) {
85 encoder, err := NewEncoder("/", "", http.Header{})

Callers

nothing calls this directly

Calls 5

HasHeaderMethod · 0.95
AddHeaderMethod · 0.95
ErrorfMethod · 0.80
NewEncoderFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected