MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / TestPresetsFileNotFound

Function TestPresetsFileNotFound

options/parser/config_test.go:84–97  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

82}
83
84func 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
99func TestPresetsFromBothSources(t *testing.T) {
100 // Create temporary preset file

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.65

Tested by

no test coverage detected