File: auth_test.go

package info (click to toggle)
golang-github-samalba-dockerclient 0.0~git20160531.0.a303626-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 204 kB
  • sloc: makefile: 5
file content (15 lines) | stat: -rwxr-xr-x 384 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package dockerclient

import (
	"testing"
)

func TestAuthEncode(t *testing.T) {
	a := AuthConfig{Username: "foo", Password: "password", Email: "bar@baz.com"}
	expected := "eyJ1c2VybmFtZSI6ImZvbyIsInBhc3N3b3JkIjoicGFzc3dvcmQiLCJlbWFpbCI6ImJhckBiYXouY29tIn0K"
	got, _ := a.encode()

	if expected != got {
		t.Errorf("testAuthEncode failed. Expected [%s] got [%s]", expected, got)
	}
}