You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helm/pkg/uploader/chart_uploader_test.go

31 lines
738 B

package uploader
import (
"fmt"
"testing"
"helm.sh/helm/v3/pkg/registry"
)
func TestUploadTo_InvalidFormatError(t *testing.T) {
c := ChartUploader{}
remote := "0.google.com:443/abc"
got := c.UploadTo("", remote).Error()
want := fmt.Errorf("invalid chart URL format: %s", remote).Error()
if got != want {
t.Errorf("expected error to be equal to %v, got %v", want, got)
}
}
func TestUploadTo_SchemaPrefixMissingError(t *testing.T) {
c := ChartUploader{}
remote := "www.github.com/helm/helm"
got := c.UploadTo("", remote).Error()
want := fmt.Errorf("scheme prefix missing from remote (e.g. \"%s://\")", registry.OCIScheme).Error()
if got != want {
t.Errorf("expected error to be equal to %v, got %v", want, got)
}
}