mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
fix routes register test
This commit is contained in:
parent
38c589375a
commit
51dfcbed21
1 changed files with 9 additions and 3 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue