harness-drone/vendor/github.com/samalba/dockerclient/auth_test.go
2015-09-29 18:21:17 -07:00

15 lines
384 B
Go

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)
}
}