Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit d7a4d59

Browse files
committed
Fix default prefix to be PELICAN
Since the binary generated for namespaces_test.go doesn't start with `stash`, the override for the test should be `PELICAN`-prefixed instead.
1 parent 636bb52 commit d7a4d59

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

namespaces/namespaces_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func TestMatchNamespace(t *testing.T) {
6767
}
6868
`)
6969

70-
err := os.Setenv("STASH_NAMESPACE_URL", "https://doesnotexist.edu/blah/nope")
70+
err := os.Setenv("PELICAN_NAMESPACE_URL", "https://doesnotexist.edu/blah/nope")
7171
if err != nil {
7272
t.Error(err)
7373
}
@@ -94,7 +94,7 @@ func TestMatchNamespace(t *testing.T) {
9494
assert.Equal(t, false, ns.ReadHTTPS)
9595
assert.Equal(t, false, ns.UseTokenOnRead)
9696

97-
err = os.Unsetenv("STASH_NAMESPACE_URL")
97+
err = os.Unsetenv("PELICAN_NAMESPACE_URL")
9898
if err != nil {
9999
t.Error(err)
100100
}
@@ -156,35 +156,35 @@ func TestFullNamespace(t *testing.T) {
156156

157157
// TestDownloadNamespaces tests the download of the namespaces JSON
158158
func TestDownloadNamespaces(t *testing.T) {
159-
os.Setenv("STASH_NAMESPACE_URL", "https://topology-itb.opensciencegrid.org/stashcache/namespaces")
159+
os.Setenv("PELICAN_NAMESPACE_URL", "https://topology-itb.opensciencegrid.org/stashcache/namespaces")
160160
viper.Reset()
161161
err := config.Init()
162162
assert.Nil(t, err)
163-
defer os.Unsetenv("STASH_NAMESPACE_URL")
163+
defer os.Unsetenv("PELICAN_NAMESPACE_URL")
164164
namespaceBytes, err := downloadNamespace()
165165
assert.NoError(t, err, "Failed to download namespaces")
166166
assert.NotNil(t, namespaceBytes, "Namespace bytes is nil")
167167

168168
}
169169

170170
func TestDownloadNamespacesFail(t *testing.T) {
171-
os.Setenv("STASH_NAMESPACE_URL", "https://doesnotexist.org.blah/namespaces.json")
171+
os.Setenv("PELICAN_NAMESPACE_URL", "https://doesnotexist.org.blah/namespaces.json")
172172
viper.Reset()
173173
err := config.Init()
174174
assert.Nil(t, err)
175-
defer os.Unsetenv("STASH_NAMESPACE_URL")
175+
defer os.Unsetenv("PELICAN_NAMESPACE_URL")
176176
namespaceBytes, err := downloadNamespace()
177177
assert.Error(t, err, "Failed to download namespaces")
178178
assert.Nil(t, namespaceBytes, "Namespace bytes is nil")
179179
}
180180

181181
func TestGetNamespaces(t *testing.T) {
182182
// Set the environment to an invalid URL, so it is forced to use the "built-in" namespaces.json
183-
os.Setenv("STASH_NAMESPACE_URL", "https://doesnotexist.org.blah/namespaces.json")
183+
os.Setenv("PELICAN_NAMESPACE_URL", "https://doesnotexist.org.blah/namespaces.json")
184184
viper.Reset()
185185
err := config.Init()
186186
assert.Nil(t, err)
187-
defer os.Unsetenv("STASH_NAMESPACE_URL")
187+
defer os.Unsetenv("PELICAN_NAMESPACE_URL")
188188
namespaces, err := GetNamespaces()
189189
assert.NoError(t, err, "Failed to get namespaces")
190190
assert.NotNil(t, namespaces, "Namespaces is nil")

0 commit comments

Comments
 (0)