Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroslav Kirillov committed Sep 12, 2024
1 parent 51f6785 commit a3a5541
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions xhttp/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,45 +36,33 @@ func TestPrepareRequest(t *testing.T) {
in: inputData{
endpoint: "http://endpoint:1",
method: fasthttp.MethodPost,
contentType: "application/json",
body: "test simple",
gzipCompressionLevel: -1,
},
want: wantData{
uri: "http://endpoint:1/",
method: []byte(fasthttp.MethodPost),
body: []byte("test simple"),
},
},
{
name: "content_type",
in: inputData{
endpoint: "http://endpoint:2",
method: fasthttp.MethodPost,
contentType: "application/x-ndjson",
body: "test content-type",
gzipCompressionLevel: -1,
},
want: wantData{
uri: "http://endpoint:2/",
uri: "http://endpoint:1/",
method: []byte(fasthttp.MethodPost),
contentType: []byte("application/x-ndjson"),
body: []byte("test content-type"),
contentType: []byte("application/json"),
body: []byte("test simple"),
},
},
{
name: "auth",
in: inputData{
endpoint: "http://endpoint:3",
method: fasthttp.MethodPost,
contentType: "application/json",
body: "test auth",
authHeader: "Auth Header",
gzipCompressionLevel: -1,
},
want: wantData{
uri: "http://endpoint:3/",
method: []byte(fasthttp.MethodPost),
body: []byte("test auth"),
auth: []byte("Auth Header"),
uri: "http://endpoint:3/",
method: []byte(fasthttp.MethodPost),
contentType: []byte("application/json"),
body: []byte("test auth"),
auth: []byte("Auth Header"),
},
},
{
Expand Down

0 comments on commit a3a5541

Please sign in to comment.