Files
query-orchestration/internal/server/env/getfatal_test.go
T
Michael McGuinness fa95d733ca Merged in feature/shorttestsanddirtidy (pull request #26)
Add short tests and Tidy internal directories

* complete the tasks
2025-01-17 12:00:32 +00:00

25 lines
403 B
Go

package env_test
import (
"queryorchestration/internal/server/env"
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetPanic(t *testing.T) {
name := "test_get_env_var_does_not_exist"
value := "value"
t.Setenv(name, value)
returnValue := env.GetPanic(name)
assert.Equal(t, value, returnValue)
value = ""
t.Setenv(name, value)
assert.Panics(t, func() { env.GetPanic(name) })
}