diff options
Diffstat (limited to 'internal/api/client/statuses')
| -rw-r--r-- | internal/api/client/statuses/status_test.go | 25 | 
1 files changed, 15 insertions, 10 deletions
diff --git a/internal/api/client/statuses/status_test.go b/internal/api/client/statuses/status_test.go index a87fd36f7..93745ffd8 100644 --- a/internal/api/client/statuses/status_test.go +++ b/internal/api/client/statuses/status_test.go @@ -21,14 +21,13 @@ package statuses_test  import (  	"github.com/stretchr/testify/suite"  	"github.com/superseriousbusiness/gotosocial/internal/api/client/statuses" -	"github.com/superseriousbusiness/gotosocial/internal/concurrency"  	"github.com/superseriousbusiness/gotosocial/internal/db"  	"github.com/superseriousbusiness/gotosocial/internal/email"  	"github.com/superseriousbusiness/gotosocial/internal/federation"  	"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"  	"github.com/superseriousbusiness/gotosocial/internal/media" -	"github.com/superseriousbusiness/gotosocial/internal/messages"  	"github.com/superseriousbusiness/gotosocial/internal/processing" +	"github.com/superseriousbusiness/gotosocial/internal/state"  	"github.com/superseriousbusiness/gotosocial/internal/storage"  	"github.com/superseriousbusiness/gotosocial/internal/typeutils"  	"github.com/superseriousbusiness/gotosocial/testrig" @@ -44,6 +43,7 @@ type StatusStandardTestSuite struct {  	emailSender  email.Sender  	processor    *processing.Processor  	storage      *storage.Driver +	state        state.State  	// standard suite models  	testTokens       map[string]*gtsmodel.Token @@ -71,22 +71,26 @@ func (suite *StatusStandardTestSuite) SetupSuite() {  }  func (suite *StatusStandardTestSuite) SetupTest() { +	suite.state.Caches.Init() +	testrig.StartWorkers(&suite.state) +  	testrig.InitTestConfig()  	testrig.InitTestLog() -	suite.db = testrig.NewTestDB() -	suite.tc = testrig.NewTestTypeConverter(suite.db) +	suite.db = testrig.NewTestDB(&suite.state) +	suite.state.DB = suite.db  	suite.storage = testrig.NewInMemoryStorage() +	suite.state.Storage = suite.storage + +	suite.tc = testrig.NewTestTypeConverter(suite.db) +  	testrig.StandardDBSetup(suite.db, nil)  	testrig.StandardStorageSetup(suite.storage, "../../../../testrig/media") -	fedWorker := concurrency.NewWorkerPool[messages.FromFederator](-1, -1) -	clientWorker := concurrency.NewWorkerPool[messages.FromClientAPI](-1, -1) - -	suite.mediaManager = testrig.NewTestMediaManager(suite.db, suite.storage) -	suite.federator = testrig.NewTestFederator(suite.db, testrig.NewTestTransportController(testrig.NewMockHTTPClient(nil, "../../../../testrig/media"), suite.db, fedWorker), suite.storage, suite.mediaManager, fedWorker) +	suite.mediaManager = testrig.NewTestMediaManager(&suite.state) +	suite.federator = testrig.NewTestFederator(&suite.state, testrig.NewTestTransportController(&suite.state, testrig.NewMockHTTPClient(nil, "../../../../testrig/media")), suite.mediaManager)  	suite.emailSender = testrig.NewEmailSender("../../../../web/template/", nil) -	suite.processor = testrig.NewTestProcessor(suite.db, suite.storage, suite.federator, suite.emailSender, suite.mediaManager, clientWorker, fedWorker) +	suite.processor = testrig.NewTestProcessor(&suite.state, suite.federator, suite.emailSender, suite.mediaManager)  	suite.statusModule = statuses.New(suite.processor)  	suite.NoError(suite.processor.Start()) @@ -95,4 +99,5 @@ func (suite *StatusStandardTestSuite) SetupTest() {  func (suite *StatusStandardTestSuite) TearDownTest() {  	testrig.StandardDBTeardown(suite.db)  	testrig.StandardStorageTeardown(suite.storage) +	testrig.StopWorkers(&suite.state)  }  | 
