mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Rename context package to config and fsutil to util
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user