From 71296800efe09f8189e8fbb6f06991270049317d Mon Sep 17 00:00:00 2001 From: Stephan D Date: Fri, 13 Feb 2026 15:53:52 +0100 Subject: [PATCH] test fix --- .../server/fileserviceimp/storage/localfs_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/api/server/internal/server/fileserviceimp/storage/localfs_test.go b/api/server/internal/server/fileserviceimp/storage/localfs_test.go index 68abc372..da1a13bd 100644 --- a/api/server/internal/server/fileserviceimp/storage/localfs_test.go +++ b/api/server/internal/server/fileserviceimp/storage/localfs_test.go @@ -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) -- 2.49.1