yanic/webserver/webserver_test.go
Julian Kornberger b560e275db Change port for webserver test
8080 is taken on my dev machine
2018-01-13 14:13:44 +01:00

26 lines
342 B
Go

package webserver
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestWebserver(t *testing.T) {
assert := assert.New(t)
srv := New(":12345", "/tmp")
assert.NotNil(srv)
go Start(srv)
time.Sleep(time.Millisecond * 200)
assert.Panics(func() {
Start(srv)
}, "not allowed to listen twice")
srv.Close()
}