summaryrefslogtreecommitdiff
path: root/internal/federation/federator_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-12-20 15:19:53 +0100
committerLibravatar GitHub <noreply@github.com>2021-12-20 15:19:53 +0100
commitcb8688f4298a1a3ed5e28565004588be3c071df0 (patch)
tree038b196e914b949857bf8b7c00f22374408bc1ca /internal/federation/federator_test.go
parentreturn first offer when no accept header set (#351) (diff)
downloadgotosocial-cb8688f4298a1a3ed5e28565004588be3c071df0.tar.xz
Remove unnecessary storage config variables (#344)
* rewire config to not use extraneous serve vars * rename 'file' to 'local' for consistency * use Type and Size again
Diffstat (limited to 'internal/federation/federator_test.go')
-rw-r--r--internal/federation/federator_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/federation/federator_test.go b/internal/federation/federator_test.go
index f907ac00b..20a0b7d46 100644
--- a/internal/federation/federator_test.go
+++ b/internal/federation/federator_test.go
@@ -30,11 +30,11 @@ import (
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/activity/pub"
+ "github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/federation"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
- "github.com/superseriousbusiness/gotosocial/internal/util"
"github.com/superseriousbusiness/gotosocial/testrig"
)
@@ -91,7 +91,7 @@ func (suite *ProtocolTestSuite) TestPostInboxRequestBodyHook() {
assert.NotNil(suite.T(), newContext)
// activity should be set on context now
- activityI := newContext.Value(util.APActivity)
+ activityI := newContext.Value(ap.ContextActivity)
assert.NotNil(suite.T(), activityI)
returnedActivity, ok := activityI.(pub.Activity)
assert.True(suite.T(), ok)
@@ -121,10 +121,10 @@ func (suite *ProtocolTestSuite) TestAuthenticatePostInbox() {
ctx := context.Background()
// by the time AuthenticatePostInbox is called, PostInboxRequestBodyHook should have already been called,
// which should have set the account and username onto the request. We can replicate that behavior here:
- ctxWithAccount := context.WithValue(ctx, util.APReceivingAccount, inboxAccount)
- ctxWithActivity := context.WithValue(ctxWithAccount, util.APActivity, activity)
- ctxWithVerifier := context.WithValue(ctxWithActivity, util.APRequestingPublicKeyVerifier, verifier)
- ctxWithSignature := context.WithValue(ctxWithVerifier, util.APRequestingPublicKeySignature, activity.SignatureHeader)
+ ctxWithAccount := context.WithValue(ctx, ap.ContextReceivingAccount, inboxAccount)
+ ctxWithActivity := context.WithValue(ctxWithAccount, ap.ContextActivity, activity)
+ ctxWithVerifier := context.WithValue(ctxWithActivity, ap.ContextRequestingPublicKeyVerifier, verifier)
+ ctxWithSignature := context.WithValue(ctxWithVerifier, ap.ContextRequestingPublicKeySignature, activity.SignatureHeader)
// we can pass this recorder as a writer and read it back after
recorder := httptest.NewRecorder()
@@ -135,7 +135,7 @@ func (suite *ProtocolTestSuite) TestAuthenticatePostInbox() {
assert.True(suite.T(), authed)
// since we know this account already it should be set on the context
- requestingAccountI := newContext.Value(util.APRequestingAccount)
+ requestingAccountI := newContext.Value(ap.ContextRequestingAccount)
assert.NotNil(suite.T(), requestingAccountI)
requestingAccount, ok := requestingAccountI.(*gtsmodel.Account)
assert.True(suite.T(), ok)