mirror of
https://github.com/thegeeklab/drone-docker-buildx.git
synced 2024-11-05 04:20:41 +00:00
24 lines
627 B
Go
24 lines
627 B
Go
package plugin
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestRegistries(t *testing.T) {
|
|
p := &Plugin{}
|
|
p.settings.Login.RegistriesRaw = `[{"username": "docker_user", "password": "docker_password"}]`
|
|
|
|
assert.NoError(t, p.Validate())
|
|
|
|
fmt.Println(p.settings.Login.Registries[0].Password)
|
|
|
|
if assert.Len(t, p.settings.Login.Registries, 1) {
|
|
assert.EqualValues(t, "docker_user", p.settings.Login.Registries[0].Username)
|
|
assert.EqualValues(t, "docker_password", p.settings.Login.Registries[0].Password)
|
|
assert.EqualValues(t, DefaultRegistry, p.settings.Login.Registries[0].Registry)
|
|
}
|
|
}
|