mirror of
https://github.com/restic/restic.git
synced 2025-12-03 20:11:52 +00:00
repository: unify repository initialization in tests
Tests should use a helper from internal/repository/testing.go to construct a Repository object.
This commit is contained in:
@@ -15,11 +15,9 @@ import (
|
||||
var repoFixture = filepath.Join("..", "repository", "testdata", "test-repo.tar.gz")
|
||||
|
||||
func TestRepositoryForAllIndexes(t *testing.T) {
|
||||
repodir, cleanup := rtest.Env(t, repoFixture)
|
||||
repo, cleanup := repository.TestFromFixture(t, repoFixture)
|
||||
defer cleanup()
|
||||
|
||||
repo := repository.TestOpenLocal(t, repodir)
|
||||
|
||||
expectedIndexIDs := restic.NewIDSet()
|
||||
rtest.OK(t, repo.List(context.TODO(), restic.IndexFile, func(id restic.ID, size int64) error {
|
||||
expectedIndexIDs.Insert(id)
|
||||
|
||||
Reference in New Issue
Block a user