MCPcopy Create free account
hub / github.com/astercloud/aster / TestExpandVariablesDisabled

Function TestExpandVariablesDisabled

pkg/config/loader_test.go:141–153  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

139}
140
141func TestExpandVariablesDisabled(t *testing.T) {
142 _ = os.Setenv("TEST_VAR", "test_value")
143 defer func() { _ = os.Unsetenv("TEST_VAR") }()
144
145 loader := NewLoader(WithEnvExpansion(false))
146
147 // When expansion is disabled, expandVariables should still work
148 // but LoadFromString won't call it
149 result := loader.expandVariables("${TEST_VAR}")
150 if result != "test_value" {
151 t.Errorf("expected 'test_value', got %q", result)
152 }
153}
154
155func TestLoadFromString(t *testing.T) {
156 _ = os.Setenv("API_KEY", "sk-test-key")

Callers

nothing calls this directly

Calls 3

expandVariablesMethod · 0.95
WithEnvExpansionFunction · 0.85
NewLoaderFunction · 0.70

Tested by

no test coverage detected