summaryrefslogtreecommitdiff
path: root/internal/media/media_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-12-10 22:43:11 +0100
committerLibravatar GitHub <noreply@github.com>2022-12-10 21:43:11 +0000
commit5e060d0bcb9af77e7b6d11acba99db6219d4f68e (patch)
tree8dee821f5577ed38be754d73370ed2b74c8f0d2b /internal/media/media_test.go
parent[chore] make single pull request template (#1239) (diff)
downloadgotosocial-5e060d0bcb9af77e7b6d11acba99db6219d4f68e.tar.xz
[feature] Start implementing refetch of lost media files via `/api/v1/admin/media_refetch` (#1221)
* [chore] Move ShortcodeDomain to its own little util func * [feature] Add RefetchEmojis function to media manager * [feature] Expose admin media refresh via admin API * update following review feedback - change/fix log levels - make sure not to try to refetch local emojis - small style refactoring + comments * log on emoji refetch start Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/media/media_test.go')
-rw-r--r--internal/media/media_test.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/internal/media/media_test.go b/internal/media/media_test.go
index 435994073..05408497c 100644
--- a/internal/media/media_test.go
+++ b/internal/media/media_test.go
@@ -20,22 +20,26 @@ package media_test
import (
"github.com/stretchr/testify/suite"
+ "github.com/superseriousbusiness/gotosocial/internal/concurrency"
"github.com/superseriousbusiness/gotosocial/internal/db"
gtsmodel "github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/media"
+ "github.com/superseriousbusiness/gotosocial/internal/messages"
"github.com/superseriousbusiness/gotosocial/internal/storage"
+ "github.com/superseriousbusiness/gotosocial/internal/transport"
"github.com/superseriousbusiness/gotosocial/testrig"
)
type MediaStandardTestSuite struct {
suite.Suite
- db db.DB
- storage *storage.Driver
- manager media.Manager
- testAttachments map[string]*gtsmodel.MediaAttachment
- testAccounts map[string]*gtsmodel.Account
- testEmojis map[string]*gtsmodel.Emoji
+ db db.DB
+ storage *storage.Driver
+ manager media.Manager
+ transportController transport.Controller
+ testAttachments map[string]*gtsmodel.MediaAttachment
+ testAccounts map[string]*gtsmodel.Account
+ testEmojis map[string]*gtsmodel.Emoji
}
func (suite *MediaStandardTestSuite) SetupSuite() {
@@ -53,6 +57,7 @@ func (suite *MediaStandardTestSuite) SetupTest() {
suite.testAccounts = testrig.NewTestAccounts()
suite.testEmojis = testrig.NewTestEmojis()
suite.manager = testrig.NewTestMediaManager(suite.db, suite.storage)
+ suite.transportController = testrig.NewTestTransportController(testrig.NewMockHTTPClient(nil, "../../testrig/media"), suite.db, concurrency.NewWorkerPool[messages.FromFederator](0, 0))
}
func (suite *MediaStandardTestSuite) TearDownTest() {