mirror of
https://github.com/tcsenpai/ollama.git
synced 2025-06-07 11:45:21 +00:00
Merge pull request #4331 from dhiltgen/fix_unit
Fix envconfig unit test
This commit is contained in:
commit
c60a086635
@ -1,20 +1,20 @@
|
|||||||
package envconfig
|
package envconfig
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestConfig(t *testing.T) {
|
func TestConfig(t *testing.T) {
|
||||||
os.Setenv("OLLAMA_DEBUG", "")
|
Debug = false // Reset whatever was loaded in init()
|
||||||
|
t.Setenv("OLLAMA_DEBUG", "")
|
||||||
LoadConfig()
|
LoadConfig()
|
||||||
require.False(t, Debug)
|
require.False(t, Debug)
|
||||||
os.Setenv("OLLAMA_DEBUG", "false")
|
t.Setenv("OLLAMA_DEBUG", "false")
|
||||||
LoadConfig()
|
LoadConfig()
|
||||||
require.False(t, Debug)
|
require.False(t, Debug)
|
||||||
os.Setenv("OLLAMA_DEBUG", "1")
|
t.Setenv("OLLAMA_DEBUG", "1")
|
||||||
LoadConfig()
|
LoadConfig()
|
||||||
require.True(t, Debug)
|
require.True(t, Debug)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user