Linting #509

Merged
tech merged 46 commits from main into dis-474 2026-02-13 16:14:15 +00:00
Showing only changes of commit 1c564daa41 - Show all commits

View File

@@ -369,9 +369,18 @@ func TestCreateLocalFileStorage(t *testing.T) {
} }
func TestCreateLocalFileStorage_InvalidPath(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() logger := zap.NewNop()
cfg := config.LocalFSSConfig{ 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) storage, err := CreateLocalFileStorage(logger, mservice.Storage, "test", "sub", &mockDomainProvider{}, cfg)