This commit is contained in:
2025-08-30 10:30:53 +03:00
parent 2e7ab5e382
commit 3654383ad2
9 changed files with 34 additions and 40 deletions

View File

@@ -127,15 +127,6 @@ func dotest(ctx context.Context, db *sql.DB, t *testing.T) {
t.Errorf("incorrect error on delete for non-existing id, want: %v, have: %v", repo.ErrNotFound, err)
}
if err := r.Purge(ctx, testID); err != nil {
t.Error(err)
}
if err := r.Purge(ctx, testID); err == nil || !errors.Is(err, repo.ErrNotFound) {
// can only purge once
t.Errorf("incorrect error on delete for non-existing id, want: %v, have: %v", repo.ErrNotFound, err)
}
if _, err := r.Read(ctx, incorrectID); err == nil || !errors.Is(err, repo.ErrNotFound) {
t.Errorf("incorrect error on read for non-existing id, want: %v, have: %v", repo.ErrNotFound, err)
}
@@ -148,7 +139,4 @@ func dotest(ctx context.Context, db *sql.DB, t *testing.T) {
t.Errorf("incorrect error on delete for non-existing id, want: %v, have: %v", repo.ErrNotFound, err)
}
if err := r.Purge(ctx, incorrectID); err == nil || !errors.Is(err, repo.ErrNotFound) {
t.Errorf("incorrect error on purge for non-existing id, want: %v, have: %v", repo.ErrNotFound, err)
}
}