grim/convey
Clone
Summary
Browse
Changes
Graph
Add documentation for the podman tasks
redux
2021-10-16, Gary Kramlich
fd65c6d6f2ab
Add documentation for the podman tasks
package
podman
import
(
"testing"
.
"github.com/onsi/gomega"
)
func
TestTagSingleTarget
(
t
*
testing
.
T
)
{
g
:=
NewGomegaWithT
(
t
)
tag
:=
&
Tag
{
Image
:
"foo"
,
Targets
:
[]
string
{
"bar"
},
}
g
.
Expect
(
tag
.
Valid
()).
To
(
BeNil
())
}
func
TestTagMultipleTargets
(
t
*
testing
.
T
)
{
g
:=
NewGomegaWithT
(
t
)
tag
:=
&
Tag
{
Image
:
"foo"
,
Targets
:
[]
string
{
"bar"
,
"baz"
},
}
g
.
Expect
(
tag
.
Valid
()).
To
(
BeNil
())
}
func
TestTagImageRequired
(
t
*
testing
.
T
)
{
g
:=
NewGomegaWithT
(
t
)
tag
:=
&
Tag
{
Targets
:
[]
string
{
"bar"
},
}
g
.
Expect
(
tag
.
Valid
()).
To
(
MatchError
(
ErrNoImage
))
}
func
TestTagTargetRequired
(
t
*
testing
.
T
)
{
g
:=
NewGomegaWithT
(
t
)
tag
:=
&
Tag
{
Image
:
"foo"
,
}
g
.
Expect
(
tag
.
Valid
()).
To
(
MatchError
(
ErrNoTargets
))
}