Files
query-orchestration/internal/env/getfatal_test.go
T

25 lines
396 B
Go
Raw Normal View History

package env_test
import (
2024-12-24 17:13:48 +00:00
"queryorchestration/internal/env"
"testing"
"github.com/stretchr/testify/assert"
)
2024-12-24 18:11:25 +00:00
func TestGetPanic(t *testing.T) {
name := "test_get_env_var_does_not_exist"
value := "value"
t.Setenv(name, value)
2024-12-24 18:11:25 +00:00
returnValue := env.GetPanic(name)
assert.Equal(t, value, returnValue)
value = ""
t.Setenv(name, value)
2024-12-24 18:11:25 +00:00
assert.Panics(t, func() { env.GetPanic(name) })
}