ollama/server/envconfig/config_test.go

24 lines
470 B
Go
Raw Normal View History

package envconfig
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestConfig(t *testing.T) {
2024-05-10 23:49:48 +00:00
Debug = false // Reset whatever was loaded in init()
t.Setenv("OLLAMA_DEBUG", "")
LoadConfig()
require.False(t, Debug)
2024-05-10 23:49:48 +00:00
t.Setenv("OLLAMA_DEBUG", "false")
LoadConfig()
require.False(t, Debug)
2024-05-10 23:49:48 +00:00
t.Setenv("OLLAMA_DEBUG", "1")
LoadConfig()
require.True(t, Debug)
t.Setenv("OLLAMA_FLASH_ATTENTION", "1")
LoadConfig()
require.True(t, FlashAttention)
}