test(mock): DeletePushMirrors & AddPushMirrorRemote

make them into variables that can be mocked

(cherry picked from commit 5747951cc7)
This commit is contained in:
Earl Warren 2024-05-29 19:52:26 +02:00 committed by GitHub
parent bcb473dd2a
commit d900842fd7
2 changed files with 6 additions and 2 deletions

View file

@ -94,7 +94,9 @@ func UpdatePushMirrorInterval(ctx context.Context, m *PushMirror) error {
return err
}
func DeletePushMirrors(ctx context.Context, opts PushMirrorOptions) error {
var DeletePushMirrors = deletePushMirrors
func deletePushMirrors(ctx context.Context, opts PushMirrorOptions) error {
if opts.RepoID > 0 {
_, err := db.Delete[PushMirror](ctx, opts)
return err