genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0

Update log_test.go

This commit is contained in:
Geno 2017-03-30 14:40:17 +02:00 committed by GitHub
parent 315749161c
commit d3346fa0a0
1 changed files with 12 additions and 12 deletions

View File

@ -1,22 +1,22 @@
package lib package lib
import ( import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
func TestLog(t *testing.T) { func TestLog(t *testing.T) {
assertion = assert.New(t) assertion = assert.New(t)
// No values check, just if it crashed or not // No values check, just if it crashed or not
LogTimestamp(false) LogTimestamp(false)
req, _ := http.NewRequest("GET", "https://google.com/lola/duda?q=wasd") req, _ := http.NewRequest("GET", "https://google.com/lola/duda?q=wasd")
log := Log.GetHTTP(req) log := LogHTTP(req)
_, ok := log.Data["remote"] _, ok := log.Data["remote"]
assertion.NotNil(ok, "remote address not set in logger") assertion.NotNil(ok, "remote address not set in logger")
assertion.Equal("GET", log.Data["method"], "method not set in logger") assertion.Equal("GET", log.Data["method"], "method not set in logger")
assertion.Equal("/lola/duda?q=wasd", log.Data["url"], "path not set in logger") assertion.Equal("/lola/duda?q=wasd", log.Data["url"], "path not set in logger")
} }