genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
hs_monolith/lib/log/main_test.go

21 lines
490 B
Go
Raw Normal View History

package log
2017-03-30 14:49:14 +02:00
import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
func TestLog(t *testing.T) {
assertion := assert.New(t)
req, _ := http.NewRequest("GET", "https://google.com/lola/duda?q=wasd", nil)
log := HTTP(req)
2017-03-30 14:49:14 +02:00
_, 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")
}