backend: remove Test method

The Test method was only used in exactly one place, namely when trying
to create a new repository it was used to check whether a config file
already exists.

Use a combination of Stat() and IsNotExist() instead.
This commit is contained in:
Michael Eischer
2022-12-03 11:28:10 +01:00
parent 57d8eedb88
commit 40ac678252
24 changed files with 47 additions and 230 deletions

View File

@@ -289,9 +289,7 @@ func TestBackendCanceledContext(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
cancel()
_, err := retryBackend.Test(ctx, h)
assertIsCanceled(t, err)
_, err = retryBackend.Stat(ctx, h)
_, err := retryBackend.Stat(ctx, h)
assertIsCanceled(t, err)
err = retryBackend.Save(ctx, h, restic.NewByteReader([]byte{}, nil))