grim/convey
Clone
Summary
Browse
Changes
Graph
replace gomega with testify and other go.mod cleanups
redux
2021-11-18, Gary Kramlich
36f6e7a6b6ce
replace gomega with testify and other go.mod cleanups
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
)
}