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

Function TestEncoderHasQuery

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

Source from the content-addressed store, hash-verified

82}
83
84func TestEncoderHasQuery(t *testing.T) {
85 encoder, err := NewEncoder("/", "", http.Header{})
86 if err != nil {
87 t.Fatalf("expected no error, got %v", err)
88 }
89
90 if q := "i-dont-exist"; encoder.HasQuery(q) {
91 t.Errorf("expect %v not to be set", q)
92 }
93
94 encoder.AddQuery("I-do-exist").String("some value")
95
96 if q := "I-do-exist"; !encoder.HasQuery(q) {
97 t.Errorf("expect %v to be set", q)
98 }
99
100}
101
102func TestEncodeContentLength(t *testing.T) {
103 cases := map[string]struct {

Callers

nothing calls this directly

Calls 5

HasQueryMethod · 0.95
AddQueryMethod · 0.95
ErrorfMethod · 0.80
NewEncoderFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected