summaryrefslogtreecommitdiff
path: root/internal/api/client/user/user_test.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-01-10 18:36:09 +0100
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-01-10 18:36:09 +0100
commite0f9323b9aa98b55f3557086f7b0a17047943f39 (patch)
tree5a2bbcb84b87d2530e804067d72c1bea672412a1 /internal/api/client/user/user_test.go
parentadd async test (diff)
downloadgotosocial-e0f9323b9aa98b55f3557086f7b0a17047943f39.tar.xz
test the media manager a bit, add shutdown logic
Diffstat (limited to 'internal/api/client/user/user_test.go')
-rw-r--r--internal/api/client/user/user_test.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/internal/api/client/user/user_test.go b/internal/api/client/user/user_test.go
index d60bf2f1a..e84a78cde 100644
--- a/internal/api/client/user/user_test.go
+++ b/internal/api/client/user/user_test.go
@@ -26,6 +26,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/processing"
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
"github.com/superseriousbusiness/gotosocial/testrig"
@@ -33,12 +34,13 @@ import (
type UserStandardTestSuite struct {
suite.Suite
- db db.DB
- tc typeutils.TypeConverter
- federator federation.Federator
- emailSender email.Sender
- processor processing.Processor
- storage *kv.KVStore
+ db db.DB
+ tc typeutils.TypeConverter
+ mediaManager media.Manager
+ federator federation.Federator
+ emailSender email.Sender
+ processor processing.Processor
+ storage *kv.KVStore
testTokens map[string]*gtsmodel.Token
testClients map[string]*gtsmodel.Client
@@ -62,10 +64,11 @@ func (suite *UserStandardTestSuite) SetupTest() {
suite.db = testrig.NewTestDB()
suite.storage = testrig.NewTestStorage()
suite.tc = testrig.NewTestTypeConverter(suite.db)
- 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.userModule = user.New(suite.processor).(*user.Module)
testrig.StandardDBSetup(suite.db, suite.testAccounts)
testrig.StandardStorageSetup(suite.storage, "../../../../testrig/media")