summaryrefslogtreecommitdiff
path: root/internal/processing/account/account_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing/account/account_test.go')
-rw-r--r--internal/processing/account/account_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/processing/account/account_test.go b/internal/processing/account/account_test.go
index 244fc89d6..10d5f91e1 100644
--- a/internal/processing/account/account_test.go
+++ b/internal/processing/account/account_test.go
@@ -19,6 +19,7 @@ package account_test
import (
"context"
+ "time"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/db"
@@ -48,7 +49,6 @@ type AccountStandardTestSuite struct {
state state.State
mediaManager *media.Manager
oauthServer oauth.Server
- fromClientAPIChan chan messages.FromClientAPI
transportController transport.Controller
federator *federation.Federator
emailSender email.Sender
@@ -68,6 +68,13 @@ type AccountStandardTestSuite struct {
accountProcessor account.Processor
}
+func (suite *AccountStandardTestSuite) getClientMsg(timeout time.Duration) (*messages.FromClientAPI, bool) {
+ ctx := context.Background()
+ ctx, cncl := context.WithTimeout(ctx, timeout)
+ defer cncl()
+ return suite.state.Workers.Client.Queue.PopCtx(ctx)
+}
+
func (suite *AccountStandardTestSuite) SetupSuite() {
suite.testTokens = testrig.NewTestTokens()
suite.testClients = testrig.NewTestClients()
@@ -101,13 +108,6 @@ func (suite *AccountStandardTestSuite) SetupTest() {
suite.mediaManager = testrig.NewTestMediaManager(&suite.state)
suite.oauthServer = testrig.NewTestOauthServer(suite.db)
- suite.fromClientAPIChan = make(chan messages.FromClientAPI, 100)
- suite.state.Workers.EnqueueClientAPI = func(ctx context.Context, msgs ...messages.FromClientAPI) {
- for _, msg := range msgs {
- suite.fromClientAPIChan <- msg
- }
- }
-
suite.transportController = testrig.NewTestTransportController(&suite.state, testrig.NewMockHTTPClient(nil, "../../../testrig/media"))
suite.federator = testrig.NewTestFederator(&suite.state, suite.transportController, suite.mediaManager)
suite.sentEmails = make(map[string]string)