mirror of
https://github.com/restic/restic.git
synced 2026-11-06 15:29:21 +00:00
prune: simplify test setup
This commit is contained in:
1 parent
bba1b68082
commit
f515b862de
1 file changed
+2
-4
@@ -209,12 +209,10 @@ func (b *failingListBackend) List(ctx context.Context, t backend.FileType, fn fu
|
||||
}
|
||||
|
||||
func TestPrunePackListError(t *testing.T) {
|
||||
random := rand.New(rand.NewSource(1))
|
||||
repo, _, be := repository.TestRepositoryWithVersion(t, 0)
|
||||
createRandomBlobs(t, random, repo, 2, 0.5, true)
|
||||
_, _, be := repository.TestRepositoryWithVersion(t, 0)
|
||||
|
||||
listErr := errors.New("request timeout")
|
||||
repo = repository.TestOpenBackend(t, &failingListBackend{Backend: be, err: listErr})
|
||||
repo := repository.TestOpenBackend(t, &failingListBackend{Backend: be, err: listErr})
|
||||
rtest.OK(t, repo.LoadIndex(context.TODO(), restic.NoopTerminalCounterFactory))
|
||||
|
||||
_, err := repository.PlanPrune(context.TODO(), repository.PruneOptions{
|
||||
|
||||
Reference in new issue
Block a user