Skip to content

Commit 9657302

Browse files
committed
use testURL variable
Signed-off-by: Somtochi Onyekwere <[email protected]>
1 parent b40e5b6 commit 9657302

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

internal/helm/repository/oci_chart_repository_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func TestOCIChartRepository_Get(t *testing.T) {
115115
New: helmgetter.NewOCIGetter,
116116
},
117117
}
118+
testURL := "oci://localhost:5000/my_repo"
118119

119120
testCases := []struct {
120121
name string
@@ -126,43 +127,43 @@ func TestOCIChartRepository_Get(t *testing.T) {
126127
{
127128
name: "should return latest stable version",
128129
version: "",
129-
url: "oci://localhost:5000/my_repo",
130+
url: testURL,
130131
expected: "1.0.0",
131132
},
132133
{
133134
name: "should return latest stable version (asterisk)",
134135
version: "*",
135-
url: "oci://localhost:5000/my_repo",
136+
url: testURL,
136137
expected: "1.0.0",
137138
},
138139
{
139140
name: "should return latest stable version (semver range)",
140141
version: ">=0.1.5",
141-
url: "oci://localhost:5000/my_repo",
142+
url: testURL,
142143
expected: "1.0.0",
143144
},
144145
{
145146
name: "should return 0.2.0 (semver range)",
146147
version: "0.2.x",
147-
url: "oci://localhost:5000/my_repo",
148+
url: testURL,
148149
expected: "0.2.0",
149150
},
150151
{
151152
name: "should return a perfect match",
152153
version: "0.1.0",
153-
url: "oci://localhost:5000/my_repo",
154+
url: testURL,
154155
expected: "0.1.0",
155156
},
156157
{
157158
name: "should return 0.10.0",
158159
version: "0.*",
159-
url: "oci://localhost:5000/my_repo",
160+
url: testURL,
160161
expected: "0.10.0",
161162
},
162163
{
163164
name: "should an error for unfunfilled range",
164165
version: ">2.0.0",
165-
url: "oci://localhost:5000/my_repo",
166+
url: testURL,
166167
expectedErr: "could not locate a version matching provided version string >2.0.0",
167168
},
168169
{

0 commit comments

Comments
 (0)