| 82 | } |
| 83 | |
| 84 | func TestPresetsFileNotFound(t *testing.T) { |
| 85 | // Use a non-existent file path |
| 86 | nonExistentPath := filepath.Join(os.TempDir(), "non-existent-presets-file-"+string(rune(os.Getpid()))+".txt") |
| 87 | |
| 88 | // Setup environment with non-existent file |
| 89 | t.Setenv("IMGPROXY_PRESETS_PATH", nonExistentPath) |
| 90 | t.Setenv("IMGPROXY_PRESETS", "") |
| 91 | |
| 92 | // Load config - should error because file doesn't exist |
| 93 | _, err := optionsparser.LoadConfigFromEnv(nil) |
| 94 | |
| 95 | // Verify that error occurred due to missing file |
| 96 | require.Error(t, err) |
| 97 | } |
| 98 | |
| 99 | func TestPresetsFromBothSources(t *testing.T) { |
| 100 | // Create temporary preset file |