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