File: request_1_7_test.go

package info (click to toggle)
golang-github-aws-aws-sdk-go 1.49.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312,636 kB
  • sloc: makefile: 120
file content (25 lines) | stat: -rw-r--r-- 409 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//go:build !go1.8
// +build !go1.8

package request

import (
	"net/http"
	"strings"
	"testing"
)

func TestResetBody_WithEmptyBody(t *testing.T) {
	r := Request{
		HTTPRequest: &http.Request{},
	}

	reader := strings.NewReader("")
	r.Body = reader

	r.ResetBody()

	if a, e := r.HTTPRequest.Body, (noBody{}); a != e {
		t.Errorf("expected request body to be set to reader, got %#v", r.HTTPRequest.Body)
	}
}