skip key decryption in tests

This commit is contained in:
Michael Eischer
2026-06-15 21:05:56 +02:00
parent c021b8cde0
commit b24d05bcb4
5 changed files with 33 additions and 0 deletions
+10
View File
@@ -2,6 +2,7 @@ package repository
import (
"context"
"encoding/json"
"fmt"
"os"
"sync"
@@ -193,3 +194,12 @@ func TestCheckRepo(t testing.TB, repo *Repository) {
t.Error(err)
}
}
func TestInjectKey(t testing.TB, keyID restic.ID, key string) {
var k crypto.Key
err := json.Unmarshal([]byte(key), &k)
if err != nil {
t.Fatal(err)
}
testKeyInjection.Store(keyID, &k)
}