genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0

Create log_test.go

This commit is contained in:
Geno 2017-03-30 14:34:14 +02:00 committed by GitHub
parent e2ff34cd51
commit ad1bb3ebde
1 changed files with 22 additions and 0 deletions

22
lib/log_test.go Normal file
View File

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