Big changes

This commit is contained in:
ponzischeme89
2026-07-29 15:26:55 +12:00
parent 70914400b4
commit a265636139
73 changed files with 9593 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package config
import "testing"
func TestDefaultClientAllowanceIsOne(t *testing.T) {
t.Setenv("MEMBY_EMBY_URL", "http://emby")
t.Setenv("MEMBY_DATABASE_URL", "postgres://memby")
t.Setenv("MEMBY_MAX_CLIENTS_PER_USER", "")
cfg, err := Load()
if err != nil {
t.Fatalf("Load: %v", err)
}
if cfg.MaxClientsPerUser != 1 {
t.Fatalf("MaxClientsPerUser = %d, want 1", cfg.MaxClientsPerUser)
}
}
func TestTracearrURLAndKeyMustBeConfiguredTogether(t *testing.T) {
t.Setenv("MEMBY_EMBY_URL", "http://emby")
t.Setenv("MEMBY_DATABASE_URL", "postgres://memby")
t.Setenv("MEMBY_TRACEARR_URL", "http://tracearr")
t.Setenv("MEMBY_TRACEARR_API_KEY", "")
if _, err := Load(); err == nil {
t.Fatal("expected incomplete Tracearr configuration to fail")
}
}