From 15e6b8a84317fb7e840bd9f514ec4c9f7998b0fc Mon Sep 17 00:00:00 2001 From: Oliver O'Mahony Date: Wed, 6 Nov 2024 14:53:19 +0000 Subject: [PATCH] update test --- internal/file/file_manager_service_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/file/file_manager_service_test.go b/internal/file/file_manager_service_test.go index c7c29ceb7..38d2b52b9 100644 --- a/internal/file/file_manager_service_test.go +++ b/internal/file/file_manager_service_test.go @@ -59,12 +59,13 @@ func TestFileManagerService_UpdateFile(t *testing.T) { }, } + tempDir := os.TempDir() + for _, test := range tests { ctx := context.Background() - tempDir := os.TempDir() testFile := helpers.CreateFileWithErrorCheck(t, tempDir, "nginx.conf") - defer helpers.RemoveFileWithErrorCheck(t, testFile.Name()) + var fileMeta *mpi.FileMeta if test.isCert { fileMeta = protos.CertMeta(testFile.Name(), "") @@ -80,6 +81,8 @@ func TestFileManagerService_UpdateFile(t *testing.T) { require.NoError(t, err) assert.Equal(t, 1, fakeFileServiceClient.UpdateFileCallCount()) + + helpers.RemoveFileWithErrorCheck(t, testFile.Name()) } }