summaryrefslogtreecommitdiff
path: root/internal/processing/workers/fromclientapi_test.go
diff options
context:
space:
mode:
authorLibravatar Daenney <git@noreply.sourcery.dny.nu>2025-05-22 12:26:11 +0200
committerLibravatar kim <gruf@noreply.codeberg.org>2025-05-22 12:26:11 +0200
commitd5c9c4adc167cdb05e73f5105702cf340293e61c (patch)
tree1d21fe376099864900837eba675a965517f98e5d /internal/processing/workers/fromclientapi_test.go
parent[feature] Allow exposing allows, implement `/api/v1/domain_blocks` and `/api/... (diff)
downloadgotosocial-d5c9c4adc167cdb05e73f5105702cf340293e61c.tar.xz
[chore] Upgrade to Go 1.24 (#4187)
* Set `go.mod` to 1.24 now that it's been out for 3 months. * Update all the test to use `testing.T.Context()`. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4187 Co-authored-by: Daenney <git@noreply.sourcery.dny.nu> Co-committed-by: Daenney <git@noreply.sourcery.dny.nu>
Diffstat (limited to 'internal/processing/workers/fromclientapi_test.go')
-rw-r--r--internal/processing/workers/fromclientapi_test.go50
1 files changed, 25 insertions, 25 deletions
diff --git a/internal/processing/workers/fromclientapi_test.go b/internal/processing/workers/fromclientapi_test.go
index a1027f3e0..3abd05295 100644
--- a/internal/processing/workers/fromclientapi_test.go
+++ b/internal/processing/workers/fromclientapi_test.go
@@ -158,7 +158,7 @@ func (suite *FromClientAPITestSuite) checkStreamed(
) {
// Set a 5s timeout on context.
- ctx := context.Background()
+ ctx := suite.T().Context()
ctx, cncl := context.WithTimeout(ctx, time.Second*5)
defer cncl()
@@ -259,7 +259,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusWithNotification() {
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_1"]
testList = suite.testLists["local_account_1_list_1"]
@@ -376,7 +376,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateBackfilledStatusWithNotifi
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_1"]
testList = suite.testLists["local_account_1_list_1"]
@@ -475,7 +475,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateBackfilledStatusWithRemote
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["local_account_1"]
receivingAccount = suite.testAccounts["remote_account_1"]
@@ -531,7 +531,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusReply() {
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_1"]
testList = suite.testLists["local_account_1_list_1"]
@@ -602,7 +602,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusReplyMuted() {
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_1"]
@@ -666,7 +666,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusBoostMuted() {
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_1"]
@@ -734,7 +734,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusListRepliesPolicyLis
*testList = *suite.testLists["local_account_1_list_1"]
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_1"]
streams = suite.openStreams(ctx, testStructs.Processor, receivingAccount, []string{testList.ID})
@@ -813,7 +813,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusListRepliesPolicyLis
*testList = *suite.testLists["local_account_1_list_1"]
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_1"]
streams = suite.openStreams(ctx, testStructs.Processor, receivingAccount, []string{testList.ID})
@@ -898,7 +898,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusReplyListRepliesPoli
*testList = *suite.testLists["local_account_1_list_1"]
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_1"]
streams = suite.openStreams(ctx, testStructs.Processor, receivingAccount, []string{testList.ID})
@@ -973,7 +973,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusBoost() {
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_1"]
testList = suite.testLists["local_account_1_list_1"]
@@ -1040,7 +1040,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusBoostNoReblogs() {
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_1"]
testList = suite.testLists["local_account_1_list_1"]
@@ -1107,7 +1107,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusWhichBeginsConversat
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["local_account_2"]
receivingAccount = suite.testAccounts["local_account_1"]
streams = suite.openStreams(ctx,
@@ -1196,7 +1196,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusWhichShouldNotCreate
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["local_account_2"]
receivingAccount = suite.testAccounts["local_account_1"]
streams = suite.openStreams(ctx,
@@ -1269,7 +1269,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusWithFollowedHashtag(
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_2"]
streams = suite.openStreams(ctx,
@@ -1346,7 +1346,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusWithFollowedHashtagA
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["remote_account_1"]
receivingAccount = suite.testAccounts["local_account_2"]
streams = suite.openStreams(ctx,
@@ -1430,7 +1430,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateBoostWithFollowedHashtag()
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["remote_account_2"]
boostingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_2"]
@@ -1536,7 +1536,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateBoostWithFollowedHashtagAn
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["remote_account_1"]
boostingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_2"]
@@ -1649,7 +1649,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateBoostWithFollowedHashtagAn
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
boostingAccount = suite.testAccounts["remote_account_1"]
receivingAccount = suite.testAccounts["local_account_2"]
@@ -1760,7 +1760,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusWithAuthorOnExclusiv
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["local_account_2"]
receivingAccount = suite.testAccounts["local_account_1"]
testList = suite.testLists["local_account_1_list_1"]
@@ -1836,7 +1836,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusWithAuthorOnExclusiv
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["local_account_2"]
receivingAccount = suite.testAccounts["local_account_1"]
testInclusiveList = suite.testLists["local_account_1_list_1"]
@@ -1953,7 +1953,7 @@ func (suite *FromClientAPITestSuite) TestProcessCreateStatusWithAuthorOnExclusiv
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["local_account_2"]
receivingAccount = suite.testAccounts["local_account_1"]
testFollow = suite.testFollows["local_account_1_local_account_2"]
@@ -2080,7 +2080,7 @@ func (suite *FromClientAPITestSuite) TestProcessUpdateStatusWithFollowedHashtag(
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["admin_account"]
receivingAccount = suite.testAccounts["local_account_2"]
streams = suite.openStreams(ctx,
@@ -2156,7 +2156,7 @@ func (suite *FromClientAPITestSuite) TestProcessUpdateStatusInteractedWith() {
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
postingAccount = suite.testAccounts["local_account_1"]
receivingAccount = suite.testAccounts["admin_account"]
streams = suite.openStreams(ctx,
@@ -2244,7 +2244,7 @@ func (suite *FromClientAPITestSuite) TestProcessStatusDelete() {
defer testrig.TearDownTestStructs(testStructs)
var (
- ctx = context.Background()
+ ctx = suite.T().Context()
deletingAccount = suite.testAccounts["local_account_1"]
receivingAccount = suite.testAccounts["local_account_2"]
deletedStatus = suite.testStatuses["local_account_1_status_1"]