From 4b490802d70b1898928d0998ae7021f5881a52d0 Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 28 Nov 2023 13:03:07 +0100 Subject: [PATCH] Test creation of client only --- modules/activitypub/client_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/activitypub/client_test.go b/modules/activitypub/client_test.go index 65ea8d4d5b..23c2c58d7f 100644 --- a/modules/activitypub/client_test.go +++ b/modules/activitypub/client_test.go @@ -14,11 +14,24 @@ import ( "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" + "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" + _ "github.com/mattn/go-sqlite3" "github.com/stretchr/testify/assert" ) +func TestNewClientReturnsClient(t *testing.T) { + assert.NoError(t, unittest.PrepareTestDatabase()) + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1}) + pubID := "https://codeberg.org/api/v1/activitypub/user-id/12345" + c, err := NewClient(db.DefaultContext, user, pubID) + + log.Debug("Client: %v\nError: %v", c, err) + assert.NoError(t, err) + +} + func TestActivityPubSignedPost(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})