Skip to content

Commit 5a22747

Browse files
authored
Merge pull request #79 from replicatedhq/no-default-namespace
Add test on rewrite for channel
2 parents ea21b9a + 9ab67a7 commit 5a22747

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

pkg/pull/upstream_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package pull
2+
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/assert"
7+
)
8+
9+
func TestRewriteUpstream(t *testing.T) {
10+
tests := []struct {
11+
upstreamURI string
12+
expected string
13+
}{
14+
{
15+
upstreamURI: "app-slug",
16+
expected: "replicated://app-slug",
17+
},
18+
{
19+
upstreamURI: "app-slug/beta",
20+
expected: "replicated://app-slug/beta",
21+
},
22+
{
23+
upstreamURI: "helm://stable/mysql",
24+
expected: "helm://stable/mysql",
25+
},
26+
}
27+
for _, test := range tests {
28+
t.Run(test.upstreamURI, func(t *testing.T) {
29+
actual := RewriteUpstream(test.upstreamURI)
30+
assert.Equal(t, actual, test.expected)
31+
})
32+
}
33+
}

0 commit comments

Comments
 (0)