fix routes register test

This commit is contained in:
Steffen Vogel 2020-11-13 10:48:55 +01:00
parent 38c589375a
commit 51dfcbed21

View file

@ -23,12 +23,13 @@
package routes package routes
import ( import (
"os"
"testing"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/database" "git.rwth-aachen.de/acs/public/villas/web-backend-go/database"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"os"
"testing"
) )
var router *gin.Engine var router *gin.Engine
@ -59,6 +60,11 @@ func TestRegisterEndpoints(t *testing.T) {
} }
func TestAddTestData(t *testing.T) { func TestAddTestData(t *testing.T) {
resp, err := AddTestData("/api", router) err := configuration.InitConfig()
if err != nil {
panic(t)
}
resp, err := AddTestData(configuration.GolbalConfig, router)
assert.NoError(t, err, "Response body: %v", resp) assert.NoError(t, err, "Response body: %v", resp)
} }