Rename context package to config and fsutil to util

This commit is contained in:
Michael Mayer
2019-05-06 23:18:10 +02:00
parent cf8d4ce29b
commit 0ddef3a02d
49 changed files with 330 additions and 322 deletions

View File

@@ -5,18 +5,18 @@ import (
"net/http/httptest"
"github.com/gin-gonic/gin"
"github.com/photoprism/photoprism/internal/context"
"github.com/photoprism/photoprism/internal/config"
)
// API test helper
func NewApiTest() (app *gin.Engine, router *gin.RouterGroup, ctx *context.Context) {
ctx = context.TestContext()
func NewApiTest() (app *gin.Engine, router *gin.RouterGroup, conf *config.Config) {
conf = config.TestConfig()
gin.SetMode(gin.TestMode)
app = gin.New()
router = app.Group("/api/v1")
return app, router, ctx
return app, router, conf
}
// See https://medium.com/@craigchilds94/testing-gin-json-responses-1f258ce3b0b1