Skip to content

Commit ff53621

Browse files
committed
Check the empty file exists
1 parent a26ae19 commit ff53621

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmd/download_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ func fakeDownloadServer(requestor string) *httptest.Server {
309309
fmt.Fprint(w, "this is file 2")
310310
})
311311

312+
mux.HandleFunc("/file-3.txt", func(w http.ResponseWriter, r *http.Request) {
313+
fmt.Fprint(w, "")
314+
})
315+
312316
mux.HandleFunc("/solutions/latest", func(w http.ResponseWriter, r *http.Request) {
313317
payloadBody := fmt.Sprintf(payloadTemplate, requestor, server.URL+"/")
314318
fmt.Fprint(w, payloadBody)
@@ -346,6 +350,10 @@ func assertDownloadedCorrectFiles(t *testing.T, targetDir string) {
346350
assert.Equal(t, file.contents, string(b))
347351
})
348352
}
353+
354+
path := filepath.Join(targetDir, "bogus-track", "bogus-exercise", "file-3.txt")
355+
_, err := os.Lstat(path)
356+
assert.NoError(t, err)
349357
}
350358

351359
func TestDownloadError(t *testing.T) {
@@ -403,6 +411,7 @@ const payloadTemplate = `
403411
"files": [
404412
"file-1.txt",
405413
"subdir/file-2.txt",
414+
"file-3.txt"
406415
],
407416
"iteration": {
408417
"submitted_at": "2017-08-21t10:11:12.130z"

0 commit comments

Comments
 (0)