From 3b9c5b4b24b6489b47b6477e6ff4bf33434dd895 Mon Sep 17 00:00:00 2001 From: Fabian Seidl <fabian.seidl@h-da.de> Date: Wed, 17 Aug 2022 17:18:03 +0200 Subject: [PATCH] minor additional code cleanup --- controller/nucleus/sbiFilesystemStore_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/controller/nucleus/sbiFilesystemStore_test.go b/controller/nucleus/sbiFilesystemStore_test.go index 61bf3fdc3..24ab4dae9 100644 --- a/controller/nucleus/sbiFilesystemStore_test.go +++ b/controller/nucleus/sbiFilesystemStore_test.go @@ -9,9 +9,13 @@ import ( "github.com/google/uuid" ) +func ensureStoreFilesForTestsAreRemoved() { + ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) + ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) +} + func TestAddSbi(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) + defer ensureStoreFilesForTestsAreRemoved() pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") sbiStore := NewSbiStore(pndID) @@ -27,8 +31,7 @@ func TestAddSbi(t *testing.T) { } func TestGetAllSbis(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) + defer ensureStoreFilesForTestsAreRemoved() pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") sbiStore := NewSbiStore(pndID) @@ -66,8 +69,7 @@ func TestGetAllSbis(t *testing.T) { } func TestGetSbi(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) + defer ensureStoreFilesForTestsAreRemoved() pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") @@ -99,8 +101,7 @@ func TestGetSbi(t *testing.T) { } func TestDeleteAllSbis(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) + defer ensureStoreFilesForTestsAreRemoved() pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") sbiStore := NewSbiStore(pndID) -- GitLab