grim/convey

bd445f33e472
Move the map of runtime.Task's to the Runtime instance
package podman
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestLogin(t *testing.T) {
l := &Login{
Registry: "docker.io",
Username: "username",
Password: "password",
}
assert.NoError(t, l.Valid())
}
func TestLoginRegistryRequired(t *testing.T) {
l := &Login{
Username: "username",
Password: "password",
}
assert.ErrorIs(t, l.Valid(), ErrNoRegistry)
}
func TestLoginUsernameRequired(t *testing.T) {
l := &Login{
Registry: "docker.io",
Password: "password",
}
assert.ErrorIs(t, l.Valid(), ErrNoUsername)
}
func TestLoginPasswordRequired(t *testing.T) {
l := &Login{
Registry: "docker.io",
Username: "username",
}
assert.ErrorIs(t, l.Valid(), ErrNoPassword)
}