fix: clear env vars in TestLoadFromFile to test pure config values

The sandbox had BRAVE_API_KEY set, causing the env override to win
over the config file value in the test assertion.
This commit is contained in:
Franz Kafka 2026-03-21 15:34:06 +00:00
parent 8649864971
commit 5181073a95
4 changed files with 14 additions and 1 deletions

View file

@ -20,6 +20,14 @@ func TestLoadDefaults(t *testing.T) {
}
func TestLoadFromFile(t *testing.T) {
// Clear env vars so we test pure config file values
t.Setenv("PORT", "")
t.Setenv("HTTP_TIMEOUT", "")
t.Setenv("UPSTREAM_SEARXNG_URL", "")
t.Setenv("LOCAL_PORTED_ENGINES", "")
t.Setenv("BRAVE_API_KEY", "")
t.Setenv("BRAVE_ACCESS_TOKEN", "")
dir := t.TempDir()
path := filepath.Join(dir, "config.toml")
content := `