mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-18 08:26:45 +02:00
16 lines
381 B
Go
16 lines
381 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)
|
|
}
|
|
}
|