2022-04-22 17:38:40 +02:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2023-03-15 17:05:05 +01:00
|
|
|
func TestEnvVar(t *testing.T) {
|
|
|
|
t.Run("Test", func(t *testing.T) {
|
|
|
|
assert.Equal(t, "PHOTOPRISM_TEST", EnvVar(EnvTest))
|
|
|
|
})
|
|
|
|
t.Run("Foo", func(t *testing.T) {
|
|
|
|
assert.Equal(t, "PHOTOPRISM_FOO", EnvVar("foo"))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2022-04-22 17:38:40 +02:00
|
|
|
func TestEnv(t *testing.T) {
|
|
|
|
t.Run("True", func(t *testing.T) {
|
|
|
|
assert.True(t, Env(EnvTest))
|
|
|
|
})
|
|
|
|
t.Run("False", func(t *testing.T) {
|
|
|
|
assert.False(t, Env("foo"))
|
|
|
|
})
|
|
|
|
}
|