From cecb89d23f27dedb8a806fb3a78fc4b7636956e5 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Tue, 15 Jul 2025 18:50:26 -0400 Subject: [PATCH] fix test --- models/repo/mirror_ssh_keypair_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/repo/mirror_ssh_keypair_test.go b/models/repo/mirror_ssh_keypair_test.go index d98ba767b8..5f540a6f74 100644 --- a/models/repo/mirror_ssh_keypair_test.go +++ b/models/repo/mirror_ssh_keypair_test.go @@ -11,6 +11,7 @@ import ( repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/modules/util" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -59,7 +60,7 @@ func TestMirrorSSHKeypair(t *testing.T) { // Test retrieving non-existent keypair _, err = repo_model.GetMirrorSSHKeypairByOwner(db.DefaultContext, 999) - assert.True(t, db.IsErrNotExist(err)) + assert.ErrorIs(t, err, util.ErrNotExist) }) t.Run("GetDecryptedPrivateKey", func(t *testing.T) { @@ -98,7 +99,7 @@ func TestMirrorSSHKeypair(t *testing.T) { // Verify it's gone _, err = repo_model.GetMirrorSSHKeypairByOwner(db.DefaultContext, 5) - assert.True(t, db.IsErrNotExist(err)) + assert.ErrorIs(t, err, util.ErrNotExist) }) t.Run("RegenerateMirrorSSHKeypair", func(t *testing.T) {