test fix #504

Merged
tech merged 1 commits from test-503 into main 2026-02-13 15:12:27 +00:00

View File

@@ -369,9 +369,18 @@ func TestCreateLocalFileStorage(t *testing.T) {
}
func TestCreateLocalFileStorage_InvalidPath(t *testing.T) {
// Build a deterministic failure case: the target path already exists as a file.
tempDir, err := os.MkdirTemp("", "storage_invalid_path_test")
require.NoError(t, err)
defer os.RemoveAll(tempDir)
fileAtTargetPath := filepath.Join(tempDir, "test")
err = os.WriteFile(fileAtTargetPath, []byte("not a directory"), 0o644)
require.NoError(t, err)
logger := zap.NewNop()
cfg := config.LocalFSSConfig{
RootPath: "/invalid/path/that/does/not/exist/and/should/fail",
RootPath: tempDir,
}
storage, err := CreateLocalFileStorage(logger, mservice.Storage, "test", "sub", &mockDomainProvider{}, cfg)