Skip to content

Commit

Permalink
Fix envconfig unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
dhiltgen committed May 10, 2024
1 parent 879e2ca commit 824ee54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/envconfig/config_test.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package envconfig

import (
"os"
"testing"

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

func TestConfig(t *testing.T) {
os.Setenv("OLLAMA_DEBUG", "")
Debug = false // Reset whatever was loaded in init()
t.Setenv("OLLAMA_DEBUG", "")
LoadConfig()
require.False(t, Debug)
os.Setenv("OLLAMA_DEBUG", "false")
t.Setenv("OLLAMA_DEBUG", "false")
LoadConfig()
require.False(t, Debug)
os.Setenv("OLLAMA_DEBUG", "1")
t.Setenv("OLLAMA_DEBUG", "1")
LoadConfig()
require.True(t, Debug)
}

0 comments on commit 824ee54

Please sign in to comment.