Skip to content

Commit

Permalink
gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
aerth committed May 15, 2017
1 parent c1ef279 commit ffbfaf4
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,29 +114,29 @@ func TestHTMLHeaderFooter(t *testing.T) {
}

func sendRequest(req *http.Request) *http.Response {
dir := prepareDirectory("docs")
w := httptest.NewRecorder()
h := &Handler{
Root: http.Dir(dir),
RootString: dir,
}
h.ServeHTTP(w, req)
resp := w.Result()
dir := prepareDirectory("docs")
w := httptest.NewRecorder()
h := &Handler{
Root: http.Dir(dir),
RootString: dir,
}
h.ServeHTTP(w, req)
resp := w.Result()

return resp

return resp

}

func TestBadMethods(t *testing.T){
methods := []string{"POST", "PUT", "DELETE", "HEAD",
"OPTIONS", "TRACE", "CONNECT", "DUMMY"}
for _, method := range methods {
req, _ := http.NewRequest(method, "/", nil)
resp := sendRequest(req)
if resp.StatusCode != 404 {
t.Log("Expected 404, got:", resp.StatusCode)
t.FailNow()
}
func TestBadMethods(t *testing.T) {
methods := []string{"POST", "PUT", "DELETE", "HEAD",
"OPTIONS", "TRACE", "CONNECT", "DUMMY"}
for _, method := range methods {
req, _ := http.NewRequest(method, "/", nil)
resp := sendRequest(req)
if resp.StatusCode != 404 {
t.Log("Expected 404, got:", resp.StatusCode)
t.FailNow()
}

}
}
}

0 comments on commit ffbfaf4

Please sign in to comment.