MCPcopy
hub / github.com/kserve/kserve / TestIsPrefixSupported

Function TestIsPrefixSupported

pkg/utils/utils_test.go:550–577  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

548}
549
550func TestIsPrefixSupported(t *testing.T) {
551 g := gomega.NewGomegaWithT(t)
552 prefixes := []string{
553 "S3://",
554 "GCS://",
555 "HTTP://",
556 "HTTPS://",
557 }
558 scenarios := map[string]struct {
559 input string
560 expected bool
561 }{
562 "SupportedPrefix": {
563 input: "GCS://test/model",
564 expected: true,
565 },
566 "UnSupportedPreifx": {
567 input: "PVC://test/model",
568 expected: false,
569 },
570 }
571 for name, scenario := range scenarios {
572 t.Run(name, func(t *testing.T) {
573 res := IsPrefixSupported(scenario.input, prefixes)
574 g.Expect(res).Should(gomega.Equal(scenario.expected))
575 })
576 }
577}
578
579func TestGetEnvVarValue(t *testing.T) {
580 g := gomega.NewGomegaWithT(t)

Callers

nothing calls this directly

Calls 2

IsPrefixSupportedFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected