summaryrefslogtreecommitdiff
path: root/internal/media/pruneremote_test.go
diff options
context:
space:
mode:
authorLibravatar Sashanoraa <sasha@noraa.gay>2022-05-15 08:52:46 -0400
committerLibravatar GitHub <noreply@github.com>2022-05-15 14:52:46 +0200
commit6e947ff2662d0b9fc475c5b21e9f1cfb0bb308a0 (patch)
tree9138d4e7a988e883b7734431034c055776f255f6 /internal/media/pruneremote_test.go
parent[documentation] Nlnet application (#572) (diff)
downloadgotosocial-6e947ff2662d0b9fc475c5b21e9f1cfb0bb308a0.tar.xz
[feature] Media cleanup endpoint (#560)
Adds an admin endpoint to trigger a remote media cleanup. Fixed #348 Signed-off-by: Sashanoraa <sasha@noraa.gay>
Diffstat (limited to 'internal/media/pruneremote_test.go')
-rw-r--r--internal/media/pruneremote_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/media/pruneremote_test.go b/internal/media/pruneremote_test.go
index 9f3b65dd2..c9d040a6f 100644
--- a/internal/media/pruneremote_test.go
+++ b/internal/media/pruneremote_test.go
@@ -39,7 +39,7 @@ func (suite *PruneRemoteTestSuite) TestPruneRemote() {
totalPruned, err := suite.manager.PruneRemote(context.Background(), 1)
suite.NoError(err)
- suite.Equal(1, totalPruned)
+ suite.Equal(2, totalPruned)
prunedAttachment, err := suite.db.GetAttachmentByID(context.Background(), testAttachment.ID)
suite.NoError(err)
@@ -51,7 +51,7 @@ func (suite *PruneRemoteTestSuite) TestPruneRemote() {
func (suite *PruneRemoteTestSuite) TestPruneRemoteTwice() {
totalPruned, err := suite.manager.PruneRemote(context.Background(), 1)
suite.NoError(err)
- suite.Equal(1, totalPruned)
+ suite.Equal(2, totalPruned)
// final prune should prune nothing, since the first prune already happened
totalPrunedAgain, err := suite.manager.PruneRemote(context.Background(), 1)
@@ -65,7 +65,7 @@ func (suite *PruneRemoteTestSuite) TestPruneAndRecache() {
totalPruned, err := suite.manager.PruneRemote(ctx, 1)
suite.NoError(err)
- suite.Equal(1, totalPruned)
+ suite.Equal(2, totalPruned)
// media should no longer be stored
_, err = suite.storage.Get(testAttachment.File.Path)
@@ -118,7 +118,7 @@ func (suite *PruneRemoteTestSuite) TestPruneOneNonExistent() {
// Now attempt to prune remote for item with db entry no file
totalPruned, err := suite.manager.PruneRemote(ctx, 1)
suite.NoError(err)
- suite.Equal(1, totalPruned)
+ suite.Equal(2, totalPruned)
}
func TestPruneRemoteTestSuite(t *testing.T) {