Add ability to overwrite the default scopes in the settings file

This commit is contained in:
2025-06-20 11:31:29 +01:00
parent 7a443c626c
commit 70443f0855
5 changed files with 189 additions and 17 deletions
+9
View File
@@ -49,6 +49,11 @@ func TestCreateConfig(t *testing.T) {
if !config.ForceHTTPS {
t.Error("Expected ForceHTTPS to be true by default")
}
// Check OverrideScopes default
if config.OverrideScopes {
t.Error("Expected OverrideScopes to be false by default")
}
})
t.Run("Config Can Hold Custom Values", func(t *testing.T) {
@@ -57,6 +62,7 @@ func TestCreateConfig(t *testing.T) {
config.LogLevel = "debug"
config.RateLimit = 50
config.ForceHTTPS = false
config.OverrideScopes = true
// Verify config struct can hold custom values
if len(config.Scopes) != 1 || config.Scopes[0] != "custom_scope" {
@@ -71,6 +77,9 @@ func TestCreateConfig(t *testing.T) {
if config.ForceHTTPS {
t.Error("Config struct cannot hold custom ForceHTTPS value")
}
if !config.OverrideScopes {
t.Error("Config struct cannot hold custom OverrideScopes value")
}
})
}