util testing

pull/2/head
Karolis Rusenas 2017-06-11 20:13:03 +01:00
parent 4611d3bc44
commit 90403f6417
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package pubsub
import (
"testing"
)
func Test_extractContainerRegistryURI(t *testing.T) {
type args struct {
imageName string
}
tests := []struct {
name string
args args
want string
}{
{
name: "gcr.io/v2-namespace/hello-world:1.1",
args: args{imageName: "gcr.io/v2-namespace/hello-world:1.1"},
want: "gcr.io",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := extractContainerRegistryURI(tt.args.imageName); got != tt.want {
t.Errorf("extractContainerRegistryURI() = %v, want %v", got, tt.want)
}
})
}
}