Skip to content

Commit

Permalink
removed test for {user} log, since it is not in caddy release, yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Mancke committed Nov 14, 2017
1 parent aa943b5 commit 1c72f98
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions caddy/handler_test.go
Expand Up @@ -74,17 +74,22 @@ func Test_ServeHTTP_200(t *testing.T) {
t.Errorf("Expected returned status code to be %d, got %d", 0, status)
}

// Check that the replacer now is able to substitute the user variable in log lines
replacer, replacerOk := r.Context().Value(httpserver.ReplacerCtxKey).(httpserver.Replacer)
if !replacerOk {
t.Errorf("no replacer associated with request")

} else {
replacement := replacer.Replace("{user}")
if replacement != "bob" {
t.Errorf(`wrong replacement: expected "bob", but got %q`, replacement)
/**
TODO: This will only work with the caddy master branch or the next caddy release
// Check that the replacer now is able to substitute the user variable in log lines
replacer, replacerOk := r.Context().Value(httpserver.ReplacerCtxKey).(httpserver.Replacer)
if !replacerOk {
t.Errorf("no replacer associated with request")
} else {
replacement := replacer.Replace("{user}")
if replacement != "bob" {
t.Errorf(`wrong replacement: expected "bob", but got %q`, replacement)
}
}
}
*/
}

//Tests the login page without being logged as a user (doesn't test that the {user} replacer stays as-is)
Expand Down

0 comments on commit 1c72f98

Please sign in to comment.