mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-02 22:56:30 +00:00
15 lines
384 B
Go
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)
|
|
}
|
|
}
|