@@ -73,7 +73,8 @@ func TestMatchNamespace(t *testing.T) {
73
73
t .Error (err )
74
74
}
75
75
viper .Reset ()
76
- config .Init ()
76
+ err = config .Init ()
77
+ assert .Nil (t , err )
77
78
78
79
ns , err := MatchNamespace ("/osgconnect/private/path/to/file.txt" )
79
80
assert .NoError (t , err , "Failed to parse namespace" )
@@ -158,7 +159,8 @@ func TestFullNamespace(t *testing.T) {
158
159
func TestDownloadNamespaces (t * testing.T ) {
159
160
os .Setenv ("STASH_NAMESPACE_URL" , "https://topology-itb.opensciencegrid.org/stashcache/namespaces" )
160
161
viper .Reset ()
161
- config .Init ()
162
+ err := config .Init ()
163
+ assert .Nil (t , err )
162
164
fmt .Printf ("Prefix %s; STASH_NAMESPACE_URL: %s; config NamespaceURL: %s" , config .GetPreferredPrefix (), os .Getenv ("STASH_NAMESPACE_URL" ), viper .GetString ("NamespaceURL" ))
163
165
defer os .Unsetenv ("STASH_NAMESPACE_URL" )
164
166
namespaceBytes , err := downloadNamespace ()
@@ -170,7 +172,8 @@ func TestDownloadNamespaces(t *testing.T) {
170
172
func TestDownloadNamespacesFail (t * testing.T ) {
171
173
os .Setenv ("STASH_NAMESPACE_URL" , "https://doesnotexist.org.blah/namespaces.json" )
172
174
viper .Reset ()
173
- config .Init ()
175
+ err := config .Init ()
176
+ assert .Nil (t , err )
174
177
defer os .Unsetenv ("STASH_NAMESPACE_URL" )
175
178
namespaceBytes , err := downloadNamespace ()
176
179
assert .Error (t , err , "Failed to download namespaces" )
@@ -181,7 +184,8 @@ func TestGetNamespaces(t *testing.T) {
181
184
// Set the environment to an invalid URL, so it is forced to use the "built-in" namespaces.json
182
185
os .Setenv ("STASH_NAMESPACE_URL" , "https://doesnotexist.org.blah/namespaces.json" )
183
186
viper .Reset ()
184
- config .Init ()
187
+ err := config .Init ()
188
+ assert .Nil (t , err )
185
189
defer os .Unsetenv ("STASH_NAMESPACE_URL" )
186
190
namespaces , err := GetNamespaces ()
187
191
assert .NoError (t , err , "Failed to get namespaces" )
0 commit comments