diff options
author | 2022-01-10 18:36:09 +0100 | |
---|---|---|
committer | 2022-01-10 18:36:09 +0100 | |
commit | e0f9323b9aa98b55f3557086f7b0a17047943f39 (patch) | |
tree | 5a2bbcb84b87d2530e804067d72c1bea672412a1 /internal/api/client/account/account_test.go | |
parent | add async test (diff) | |
download | gotosocial-e0f9323b9aa98b55f3557086f7b0a17047943f39.tar.xz |
test the media manager a bit, add shutdown logic
Diffstat (limited to 'internal/api/client/account/account_test.go')
-rw-r--r-- | internal/api/client/account/account_test.go | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/internal/api/client/account/account_test.go b/internal/api/client/account/account_test.go index b642dbcb4..01c8c9599 100644 --- a/internal/api/client/account/account_test.go +++ b/internal/api/client/account/account_test.go @@ -16,6 +16,7 @@ import ( "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/oauth" "github.com/superseriousbusiness/gotosocial/internal/processing" "github.com/superseriousbusiness/gotosocial/internal/typeutils" @@ -25,13 +26,14 @@ import ( type AccountStandardTestSuite struct { // standard suite interfaces suite.Suite - db db.DB - tc typeutils.TypeConverter - storage *kv.KVStore - federator federation.Federator - processor processing.Processor - emailSender email.Sender - sentEmails map[string]string + db db.DB + tc typeutils.TypeConverter + storage *kv.KVStore + mediaManager media.Manager + federator federation.Federator + processor processing.Processor + emailSender email.Sender + sentEmails map[string]string // standard suite models testTokens map[string]*gtsmodel.Token @@ -61,10 +63,11 @@ func (suite *AccountStandardTestSuite) SetupTest() { suite.db = testrig.NewTestDB() suite.storage = testrig.NewTestStorage() testrig.InitTestLog() - suite.federator = testrig.NewTestFederator(suite.db, testrig.NewTestTransportController(testrig.NewMockHTTPClient(nil), suite.db), suite.storage) + suite.mediaManager = testrig.NewTestMediaManager(suite.db, suite.storage) + suite.federator = testrig.NewTestFederator(suite.db, testrig.NewTestTransportController(testrig.NewMockHTTPClient(nil), suite.db), suite.storage, suite.mediaManager) suite.sentEmails = make(map[string]string) suite.emailSender = testrig.NewEmailSender("../../../../web/template/", suite.sentEmails) - suite.processor = testrig.NewTestProcessor(suite.db, suite.storage, suite.federator, suite.emailSender) + suite.processor = testrig.NewTestProcessor(suite.db, suite.storage, suite.federator, suite.emailSender, suite.mediaManager) suite.accountModule = account.New(suite.processor).(*account.Module) testrig.StandardDBSetup(suite.db, nil) testrig.StandardStorageSetup(suite.storage, "../../../../testrig/media") |