fix(test): do not clobber models directory

This commit is contained in:
Michael Yang 2024-08-28 14:07:48 -07:00
parent 7416ced70f
commit e4d0a9c325

View file

@ -139,6 +139,7 @@ The temperature in San Francisco, CA is 70°F and in Toronto, Canada is 20°C.`,
func TestParseFromFileFromLayer(t *testing.T) { func TestParseFromFileFromLayer(t *testing.T) {
tempModels := t.TempDir() tempModels := t.TempDir()
t.Setenv("OLLAMA_MODELS", tempModels)
file, err := os.CreateTemp(tempModels, "") file, err := os.CreateTemp(tempModels, "")
if err != nil { if err != nil {
@ -189,6 +190,7 @@ func TestParseFromFileFromLayer(t *testing.T) {
func TestParseLayerFromCopy(t *testing.T) { func TestParseLayerFromCopy(t *testing.T) {
tempModels := t.TempDir() tempModels := t.TempDir()
t.Setenv("OLLAMA_MODELS", tempModels)
file2, err := os.CreateTemp(tempModels, "") file2, err := os.CreateTemp(tempModels, "")
if err != nil { if err != nil {