backend: Adjust tests to use the Factory to instantiate the backend

This drastically reduces the amount of duplicated test code.
This commit is contained in:
Michael Eischer 2023-06-08 16:53:55 +02:00
parent 3d3bb88745
commit 13a8b5822f
13 changed files with 119 additions and 423 deletions

View file

@ -57,7 +57,7 @@ func (s *Suite[C]) TestCreateWithConfig(t *testing.T) {
store(t, b, restic.ConfigFile, []byte("test config"))
// now create the backend again, this must fail
_, err = s.Create(*s.Config)
_, err = s.createOrError()
if err == nil {
t.Fatalf("expected error not found for creating a backend with an existing config file")
}