1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

use getUserConfigDir also in tests

Signed-off-by: Boris Kreitchman <bkreitch@gmail.com>
This commit is contained in:
Boris Kreitchman
2023-11-13 09:38:09 +02:00
parent c6ce6dfcae
commit 2b97ff222b

View File

@@ -313,8 +313,8 @@ func TestMasterKey_loadIdentities(t *testing.T) {
tmpDir := t.TempDir()
overwriteUserConfigDir(t, tmpDir)
// We need to use os.UserConfigDir and not tmpDir as it may add a suffix
cfgDir, err := os.UserConfigDir()
// We need to use getUserConfigDir and not tmpDir as it may add a suffix
cfgDir, err := getUserConfigDir()
assert.NoError(t, err)
keyPath := filepath.Join(cfgDir, SopsAgeKeyUserConfigPath)
assert.True(t, strings.HasPrefix(keyPath, cfgDir))
@@ -341,8 +341,8 @@ func TestMasterKey_loadIdentities(t *testing.T) {
tmpDir := t.TempDir()
overwriteUserConfigDir(t, tmpDir)
// We need to use os.UserConfigDir and not tmpDir as it may add a suffix
cfgDir, err := os.UserConfigDir()
// We need to use getUserConfigDir and not tmpDir as it may add a suffix
cfgDir, err := getUserConfigDir()
assert.NoError(t, err)
keyPath1 := filepath.Join(cfgDir, SopsAgeKeyUserConfigPath)
assert.True(t, strings.HasPrefix(keyPath1, cfgDir))