config_test.go 337 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package envconfig

import (
	"os"
	"testing"

	"github.com/stretchr/testify/require"
)

func TestConfig(t *testing.T) {
	os.Setenv("OLLAMA_DEBUG", "")
	LoadConfig()
	require.False(t, Debug)
	os.Setenv("OLLAMA_DEBUG", "false")
	LoadConfig()
	require.False(t, Debug)
	os.Setenv("OLLAMA_DEBUG", "1")
	LoadConfig()
	require.True(t, Debug)
}