2020-02-10 13:15:39 +01:00
|
|
|
package test
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
2020-06-02 14:29:57 -04:00
|
|
|
|
|
|
|
|
"github.com/openshift/source-to-image/pkg/cmd/cli/cmd"
|
2020-02-10 13:15:39 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestGenerate_canonizeBuilderImageArg(t *testing.T) {
|
|
|
|
|
assertCanonize := func(t *testing.T, input string, expected string) {
|
|
|
|
|
got := cmd.CanonizeBuilderImageArg(input)
|
|
|
|
|
if got != expected {
|
|
|
|
|
t.Fail()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
assertCanonize(t, "docker://docker.io/centos/nodejs-10-centos7", "docker://docker.io/centos/nodejs-10-centos7")
|
|
|
|
|
assertCanonize(t, "docker.io/centos/nodejs-10-centos7", "docker://docker.io/centos/nodejs-10-centos7")
|
|
|
|
|
}
|