photoprism/internal/server/server_test.go
Michael Mayer 94e361a8fd WebDAV: Add authorization check based on auth tokens #782 #808 #3943
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-10 16:54:13 +01:00

35 lines
687 B
Go

package server
import (
"os"
"testing"
"github.com/sirupsen/logrus"
"github.com/photoprism/photoprism/internal/config"
"github.com/photoprism/photoprism/internal/event"
"github.com/photoprism/photoprism/internal/get"
"github.com/photoprism/photoprism/internal/server/limiter"
)
func TestMain(m *testing.M) {
// Init test logger.
log = logrus.StandardLogger()
log.SetLevel(logrus.TraceLevel)
event.AuditLog = log
// Init test config.
c := config.TestConfig()
get.SetConfig(c)
// Increase login rate limit for testing.
limiter.Login = limiter.NewLimit(1, 10000)
// Run unit tests.
code := m.Run()
// Close database connection.
_ = c.CloseDb()
os.Exit(code)
}