diff options
Diffstat (limited to 'testrig')
-rw-r--r-- | testrig/actions.go | 6 | ||||
-rw-r--r-- | testrig/mediahandler.go | 4 | ||||
-rw-r--r-- | testrig/processor.go | 8 | ||||
-rw-r--r-- | testrig/storage.go | 10 |
4 files changed, 14 insertions, 14 deletions
diff --git a/testrig/actions.go b/testrig/actions.go index aa78799b8..f6d506c3c 100644 --- a/testrig/actions.go +++ b/testrig/actions.go @@ -29,7 +29,6 @@ import ( "syscall" "github.com/sirupsen/logrus" - "github.com/superseriousbusiness/gotosocial/internal/action" "github.com/superseriousbusiness/gotosocial/internal/api" "github.com/superseriousbusiness/gotosocial/internal/api/client/account" "github.com/superseriousbusiness/gotosocial/internal/api/client/admin" @@ -39,13 +38,14 @@ import ( mediaModule "github.com/superseriousbusiness/gotosocial/internal/api/client/media" "github.com/superseriousbusiness/gotosocial/internal/api/client/status" "github.com/superseriousbusiness/gotosocial/internal/api/security" + "github.com/superseriousbusiness/gotosocial/internal/cliactions" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/federation" "github.com/superseriousbusiness/gotosocial/internal/gotosocial" ) // Run creates and starts a gotosocial testrig server -var Run action.GTSAction = func(ctx context.Context, _ *config.Config, log *logrus.Logger) error { +var Run cliactions.GTSAction = func(ctx context.Context, _ *config.Config, log *logrus.Logger) error { c := NewTestConfig() dbService := NewTestDB() federatingDB := NewTestFederatingDB(dbService) @@ -99,7 +99,7 @@ var Run action.GTSAction = func(ctx context.Context, _ *config.Config, log *logr } } - gts, err := gotosocial.New(dbService, router, federator, c) + gts, err := gotosocial.NewServer(dbService, router, federator, c) if err != nil { return fmt.Errorf("error creating gotosocial service: %s", err) } diff --git a/testrig/mediahandler.go b/testrig/mediahandler.go index ef6901032..0872eefd0 100644 --- a/testrig/mediahandler.go +++ b/testrig/mediahandler.go @@ -19,13 +19,13 @@ package testrig import ( + "github.com/superseriousbusiness/gotosocial/internal/blob" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/media" - "github.com/superseriousbusiness/gotosocial/internal/storage" ) // NewTestMediaHandler returns a media handler with the default test config, the default test logger, // and the given db and storage. -func NewTestMediaHandler(db db.DB, storage storage.Storage) media.Handler { +func NewTestMediaHandler(db db.DB, storage blob.Storage) media.Handler { return media.New(NewTestConfig(), db, storage, NewTestLog()) } diff --git a/testrig/processor.go b/testrig/processor.go index 9aa8e2509..d50748f29 100644 --- a/testrig/processor.go +++ b/testrig/processor.go @@ -19,13 +19,13 @@ package testrig import ( + "github.com/superseriousbusiness/gotosocial/internal/blob" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/federation" - "github.com/superseriousbusiness/gotosocial/internal/message" - "github.com/superseriousbusiness/gotosocial/internal/storage" + "github.com/superseriousbusiness/gotosocial/internal/processing" ) // NewTestProcessor returns a Processor suitable for testing purposes -func NewTestProcessor(db db.DB, storage storage.Storage, federator federation.Federator) message.Processor { - return message.NewProcessor(NewTestConfig(), NewTestTypeConverter(db), federator, NewTestOauthServer(db), NewTestMediaHandler(db, storage), storage, db, NewTestLog()) +func NewTestProcessor(db db.DB, storage blob.Storage, federator federation.Federator) processing.Processor { + return processing.NewProcessor(NewTestConfig(), NewTestTypeConverter(db), federator, NewTestOauthServer(db), NewTestMediaHandler(db, storage), storage, db, NewTestLog()) } diff --git a/testrig/storage.go b/testrig/storage.go index 28484b2e3..a8f351ce8 100644 --- a/testrig/storage.go +++ b/testrig/storage.go @@ -22,12 +22,12 @@ import ( "fmt" "os" - "github.com/superseriousbusiness/gotosocial/internal/storage" + "github.com/superseriousbusiness/gotosocial/internal/blob" ) // NewTestStorage returns a new in memory storage with the default test config -func NewTestStorage() storage.Storage { - s, err := storage.NewInMem(NewTestConfig(), NewTestLog()) +func NewTestStorage() blob.Storage { + s, err := blob.NewInMem(NewTestConfig(), NewTestLog()) if err != nil { panic(err) } @@ -35,7 +35,7 @@ func NewTestStorage() storage.Storage { } // StandardStorageSetup populates the storage with standard test entries from the given directory. -func StandardStorageSetup(s storage.Storage, relativePath string) { +func StandardStorageSetup(s blob.Storage, relativePath string) { storedA := newTestStoredAttachments() a := NewTestAttachments() for k, paths := range storedA { @@ -92,7 +92,7 @@ func StandardStorageSetup(s storage.Storage, relativePath string) { } // StandardStorageTeardown deletes everything in storage so that it's clean for the next test -func StandardStorageTeardown(s storage.Storage) { +func StandardStorageTeardown(s blob.Storage) { keys, err := s.ListKeys() if err != nil { panic(err) |