@@ -67,7 +67,7 @@ func TestMatchNamespace(t *testing.T) {
67
67
}
68
68
` )
69
69
70
- err := os .Setenv ("STASH_NAMESPACE_URL " , "https://doesnotexist.edu/blah/nope" )
70
+ err := os .Setenv ("PELICAN_NAMESPACE_URL " , "https://doesnotexist.edu/blah/nope" )
71
71
if err != nil {
72
72
t .Error (err )
73
73
}
@@ -94,7 +94,7 @@ func TestMatchNamespace(t *testing.T) {
94
94
assert .Equal (t , false , ns .ReadHTTPS )
95
95
assert .Equal (t , false , ns .UseTokenOnRead )
96
96
97
- err = os .Unsetenv ("STASH_NAMESPACE_URL " )
97
+ err = os .Unsetenv ("PELICAN_NAMESPACE_URL " )
98
98
if err != nil {
99
99
t .Error (err )
100
100
}
@@ -156,35 +156,35 @@ func TestFullNamespace(t *testing.T) {
156
156
157
157
// TestDownloadNamespaces tests the download of the namespaces JSON
158
158
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" )
160
160
viper .Reset ()
161
161
err := config .Init ()
162
162
assert .Nil (t , err )
163
- defer os .Unsetenv ("STASH_NAMESPACE_URL " )
163
+ defer os .Unsetenv ("PELICAN_NAMESPACE_URL " )
164
164
namespaceBytes , err := downloadNamespace ()
165
165
assert .NoError (t , err , "Failed to download namespaces" )
166
166
assert .NotNil (t , namespaceBytes , "Namespace bytes is nil" )
167
167
168
168
}
169
169
170
170
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" )
172
172
viper .Reset ()
173
173
err := config .Init ()
174
174
assert .Nil (t , err )
175
- defer os .Unsetenv ("STASH_NAMESPACE_URL " )
175
+ defer os .Unsetenv ("PELICAN_NAMESPACE_URL " )
176
176
namespaceBytes , err := downloadNamespace ()
177
177
assert .Error (t , err , "Failed to download namespaces" )
178
178
assert .Nil (t , namespaceBytes , "Namespace bytes is nil" )
179
179
}
180
180
181
181
func TestGetNamespaces (t * testing.T ) {
182
182
// 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" )
184
184
viper .Reset ()
185
185
err := config .Init ()
186
186
assert .Nil (t , err )
187
- defer os .Unsetenv ("STASH_NAMESPACE_URL " )
187
+ defer os .Unsetenv ("PELICAN_NAMESPACE_URL " )
188
188
namespaces , err := GetNamespaces ()
189
189
assert .NoError (t , err , "Failed to get namespaces" )
190
190
assert .NotNil (t , namespaces , "Namespaces is nil" )
0 commit comments