From 8245e35eb8bb162bfbefa750f4f12ec0c9d0e316 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakivskyy Date: Mon, 13 Jun 2022 23:27:54 +0300 Subject: [PATCH] Make test path a constant Signed-off-by: Oleg Zhurakivskyy --- services/server/server_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/server/server_test.go b/services/server/server_test.go index 139039d9b..82dd2dd6a 100644 --- a/services/server/server_test.go +++ b/services/server/server_test.go @@ -23,8 +23,10 @@ import ( "github.com/stretchr/testify/assert" ) +const testPath = "/tmp/path/for/testing" + func TestCreateTopLevelDirectoriesErrorsWithSamePathForRootAndState(t *testing.T) { - path := "/tmp/path/for/testing" + path := testPath err := CreateTopLevelDirectories(&srvconfig.Config{ Root: path, State: path, @@ -34,7 +36,7 @@ func TestCreateTopLevelDirectoriesErrorsWithSamePathForRootAndState(t *testing.T func TestCreateTopLevelDirectoriesWithEmptyStatePath(t *testing.T) { statePath := "" - rootPath := "/tmp/path/for/testing" + rootPath := testPath err := CreateTopLevelDirectories(&srvconfig.Config{ Root: rootPath, State: statePath, @@ -43,7 +45,7 @@ func TestCreateTopLevelDirectoriesWithEmptyStatePath(t *testing.T) { } func TestCreateTopLevelDirectoriesWithEmptyRootPath(t *testing.T) { - statePath := "/tmp/path/for/testing" + statePath := testPath rootPath := "" err := CreateTopLevelDirectories(&srvconfig.Config{ Root: rootPath,