Skip to content

Commit

Permalink
Merge pull request #325 from linkernetworks/johnlin/move-assertresponse
Browse files Browse the repository at this point in the history
[Hot-fix] move assert response code function
  • Loading branch information
John-Lin authored Sep 20, 2018
2 parents 4c91312 + 494bded commit 6962fd5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/server/handler_batch_test.go

This file was deleted.

10 changes: 10 additions & 0 deletions src/server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,13 @@ func dropTestDatabase() bool {
}
return false
}

// Assert the response code
func assertResponseCode(t *testing.T, expectedCode int, resp *httptest.ResponseRecorder) {
t.Helper()
t.Logf("code:%d", resp.Code)
if expectedCode != resp.Code {
t.Errorf("status code %d expected.", expectedCode)
t.Logf("Response:\n%s", resp.Body.String())
}
}

0 comments on commit 6962fd5

Please sign in to comment.