2015-05-22 18:37:40 +00:00
|
|
|
package dockerclient
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAuthEncode(t *testing.T) {
|
|
|
|
a := AuthConfig{Username: "foo", Password: "password", Email: "bar@baz.com"}
|
|
|
|
expected := "eyJ1c2VybmFtZSI6ImZvbyIsInBhc3N3b3JkIjoicGFzc3dvcmQiLCJlbWFpbCI6ImJhckBiYXouY29tIn0K"
|
2015-09-30 01:21:17 +00:00
|
|
|
got, _ := a.encode()
|
2015-05-22 18:37:40 +00:00
|
|
|
|
|
|
|
if expected != got {
|
|
|
|
t.Errorf("testAuthEncode failed. Expected [%s] got [%s]", expected, got)
|
|
|
|
}
|
|
|
|
}
|