summaryrefslogtreecommitdiff
path: root/internal/api/client/status/status_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/status/status_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/status/status_test.go')
-rw-r--r--internal/api/client/status/status_test.go19
1 files changed, 11 insertions, 8 deletions
diff --git a/internal/api/client/status/status_test.go b/internal/api/client/status/status_test.go
index dd037f6f4..c6e5b354f 100644
--- a/internal/api/client/status/status_test.go
+++ b/internal/api/client/status/status_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"
@@ -34,12 +35,13 @@ import (
type StatusStandardTestSuite struct {
// standard suite interfaces
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
// standard suite models
testTokens map[string]*gtsmodel.Token
@@ -70,9 +72,10 @@ func (suite *StatusStandardTestSuite) SetupTest() {
suite.db = testrig.NewTestDB()
suite.tc = testrig.NewTestTypeConverter(suite.db)
suite.storage = testrig.NewTestStorage()
- 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.emailSender = testrig.NewEmailSender("../../../../web/template/", nil)
- 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.statusModule = status.New(suite.processor).(*status.Module)
testrig.StandardDBSetup(suite.db, nil)
testrig.StandardStorageSetup(suite.storage, "../../../../testrig/media")