Skip to content

Commit

Permalink
remove sonar warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsv committed Nov 27, 2023
1 parent 14ae668 commit d02758b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions store/kv/keyloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@ import (
"testing"
)

const keyloaderTestDir = "key-loader"
const keyTestDir = "key-loader"
const keyTestFile = "test.keys"

func TestNewKeysLoader(t *testing.T) {
keyDir, err := os.MkdirTemp(os.TempDir(), keyloaderTestDir)
keyDir, err := os.MkdirTemp(os.TempDir(), keyTestDir)
require.NoError(t, err)

keyPath := filepath.Join(keyDir, "test.keys")
keyPath := filepath.Join(keyDir, keyTestFile)
defer os.RemoveAll(keyPath)

loader := NewKeysLoader(keyPath)
require.Equal(t, loader.path, keyPath)
}

func Test_fileLoader_Save(t *testing.T) {
keyDir, err := os.MkdirTemp(os.TempDir(), keyloaderTestDir)
keyDir, err := os.MkdirTemp(os.TempDir(), keyTestDir)
require.NoError(t, err)

keyPath := filepath.Join(keyDir, "test.keys")
keyPath := filepath.Join(keyDir, keyTestFile)
defer os.RemoveAll(keyPath)

loader := NewKeysLoader(keyPath)
Expand All @@ -45,10 +46,10 @@ func Test_fileLoader_Save(t *testing.T) {
}

func Test_fileLoader_Load(t *testing.T) {
keyDir, err := os.MkdirTemp(os.TempDir(), keyloaderTestDir)
keyDir, err := os.MkdirTemp(os.TempDir(), keyTestDir)
require.NoError(t, err)

keyPath := filepath.Join(keyDir, "test.keys")
keyPath := filepath.Join(keyDir, keyTestFile)
defer os.RemoveAll(keyPath)

loader := NewKeysLoader(keyPath)
Expand Down

0 comments on commit d02758b

Please sign in to comment.