mirror of
https://github.com/restic/restic.git
synced 2026-11-27 23:24:48 +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:
1 parent
3ba1fa3cee
commit
dc441c57a7
5 files changed
+27
-46
No files matched your search
@@ -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