File: request_internal_test.go

package info (click to toggle)
golang-github-aws-aws-sdk-go 1.36.33-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 163,900 kB
  • sloc: makefile: 182
file content (27 lines) | stat: -rw-r--r-- 523 bytes parent folder | download | duplicates (4)
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
26
27
package request

import (
	"testing"
)

func TestCopy(t *testing.T) {
	handlers := Handlers{}
	op := &Operation{}
	op.HTTPMethod = "Foo"
	req := &Request{}
	req.Operation = op
	req.Handlers = handlers

	r := req.copy()

	if r == req {
		t.Fatal("expect request pointer copy to be different")
	}
	if r.Operation == req.Operation {
		t.Errorf("expect request operation pointer to be different")
	}

	if e, a := req.Operation.HTTPMethod, r.Operation.HTTPMethod; e != a {
		t.Errorf("expect %q http method, got %q", e, a)
	}
}