fa95d733ca
Add short tests and Tidy internal directories * complete the tasks
25 lines
403 B
Go
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) })
|
|
}
|