@@ -160,19 +160,14 @@ func TestDownload(t *testing.T) {
160160 expectedDir : filepath .Join ("users" , "alice" ),
161161 flags : map [string ]string {"uuid" : "bogus-id" },
162162 },
163- {
164- requester : true ,
165- expectedDir : filepath .Join ("teams" , "bogus-team" ),
166- flags : map [string ]string {"exercise" : "bogus-exercise" , "track" : "bogus-track" , "team" : "bogus-team" },
167- },
168163 }
169164
170165 for _ , tc := range testCases {
171166 tmpDir , err := os .MkdirTemp ("" , "download-cmd" )
172167 defer os .RemoveAll (tmpDir )
173168 assert .NoError (t , err )
174169
175- ts := fakeDownloadServer (strconv .FormatBool (tc .requester ), tc . flags [ "team" ] )
170+ ts := fakeDownloadServer (strconv .FormatBool (tc .requester ))
176171 defer ts .Close ()
177172
178173 v := viper .New ()
@@ -221,10 +216,6 @@ func TestDownloadToExistingDirectory(t *testing.T) {
221216 exerciseDir : filepath .Join ("bogus-track" , "bogus-exercise" ),
222217 flags : map [string ]string {"exercise" : "bogus-exercise" , "track" : "bogus-track" },
223218 },
224- {
225- exerciseDir : filepath .Join ("teams" , "bogus-team" , "bogus-track" , "bogus-exercise" ),
226- flags : map [string ]string {"exercise" : "bogus-exercise" , "track" : "bogus-track" , "team" : "bogus-team" },
227- },
228219 }
229220
230221 for _ , tc := range testCases {
@@ -235,7 +226,7 @@ func TestDownloadToExistingDirectory(t *testing.T) {
235226 err = os .MkdirAll (filepath .Join (tmpDir , tc .exerciseDir ), os .FileMode (0755 ))
236227 assert .NoError (t , err )
237228
238- ts := fakeDownloadServer ("true" , "" )
229+ ts := fakeDownloadServer ("true" )
239230 defer ts .Close ()
240231
241232 v := viper .New ()
@@ -273,10 +264,6 @@ func TestDownloadToExistingDirectoryWithForce(t *testing.T) {
273264 exerciseDir : filepath .Join ("bogus-track" , "bogus-exercise" ),
274265 flags : map [string ]string {"exercise" : "bogus-exercise" , "track" : "bogus-track" },
275266 },
276- {
277- exerciseDir : filepath .Join ("teams" , "bogus-team" , "bogus-track" , "bogus-exercise" ),
278- flags : map [string ]string {"exercise" : "bogus-exercise" , "track" : "bogus-track" , "team" : "bogus-team" },
279- },
280267 }
281268
282269 for _ , tc := range testCases {
@@ -287,7 +274,7 @@ func TestDownloadToExistingDirectoryWithForce(t *testing.T) {
287274 err = os .MkdirAll (filepath .Join (tmpDir , tc .exerciseDir ), os .FileMode (0755 ))
288275 assert .NoError (t , err )
289276
290- ts := fakeDownloadServer ("true" , "" )
277+ ts := fakeDownloadServer ("true" )
291278 defer ts .Close ()
292279
293280 v := viper .New ()
@@ -310,7 +297,7 @@ func TestDownloadToExistingDirectoryWithForce(t *testing.T) {
310297 }
311298}
312299
313- func fakeDownloadServer (requestor , teamSlug string ) * httptest.Server {
300+ func fakeDownloadServer (requestor string ) * httptest.Server {
314301 mux := http .NewServeMux ()
315302 server := httptest .NewServer (mux )
316303
@@ -327,15 +314,11 @@ func fakeDownloadServer(requestor, teamSlug string) *httptest.Server {
327314 })
328315
329316 mux .HandleFunc ("/solutions/latest" , func (w http.ResponseWriter , r * http.Request ) {
330- team := "null"
331- if teamSlug := r .FormValue ("team_id" ); teamSlug != "" {
332- team = fmt .Sprintf (`{"name": "Bogus Team", "slug": "%s"}` , teamSlug )
333- }
334- payloadBody := fmt .Sprintf (payloadTemplate , requestor , team , server .URL + "/" )
317+ payloadBody := fmt .Sprintf (payloadTemplate , requestor , server .URL + "/" )
335318 fmt .Fprint (w , payloadBody )
336319 })
337320 mux .HandleFunc ("/solutions/bogus-id" , func (w http.ResponseWriter , r * http.Request ) {
338- payloadBody := fmt .Sprintf (payloadTemplate , requestor , "null" , server .URL + "/" )
321+ payloadBody := fmt .Sprintf (payloadTemplate , requestor , server .URL + "/" )
339322 fmt .Fprint (w , payloadBody )
340323 })
341324
@@ -415,7 +398,6 @@ const payloadTemplate = `
415398 "handle": "alice",
416399 "is_requester": %s
417400 },
418- "team": %s,
419401 "exercise": {
420402 "id": "bogus-exercise",
421403 "instructions_url": "http://example.com/bogus-exercise",
0 commit comments