diff options
| author | 2025-05-22 12:26:11 +0200 | |
|---|---|---|
| committer | 2025-05-22 12:26:11 +0200 | |
| commit | d5c9c4adc167cdb05e73f5105702cf340293e61c (patch) | |
| tree | 1d21fe376099864900837eba675a965517f98e5d /internal/db/bundb/basic_test.go | |
| parent | [feature] Allow exposing allows, implement `/api/v1/domain_blocks` and `/api/... (diff) | |
| download | gotosocial-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/db/bundb/basic_test.go')
| -rw-r--r-- | internal/db/bundb/basic_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/db/bundb/basic_test.go b/internal/db/bundb/basic_test.go index bdda1cad3..cc4303666 100644 --- a/internal/db/bundb/basic_test.go +++ b/internal/db/bundb/basic_test.go @@ -18,7 +18,6 @@ package bundb_test import ( - "context" "crypto/rand" "crypto/rsa" "testing" @@ -37,7 +36,7 @@ func (suite *BasicTestSuite) TestGetAccountByID() { testAccount := suite.testAccounts["local_account_1"] a := >smodel.Account{} - err := suite.db.GetByID(context.Background(), testAccount.ID, a) + err := suite.db.GetByID(suite.T().Context(), testAccount.ID, a) suite.NoError(err) } @@ -60,12 +59,12 @@ func (suite *BasicTestSuite) TestPutAccountWithBunDefaultFields() { PublicKey: &key.PublicKey, } - if err := suite.db.Put(context.Background(), testAccount); err != nil { + if err := suite.db.Put(suite.T().Context(), testAccount); err != nil { suite.FailNow(err.Error()) } a := >smodel.Account{} - if err := suite.db.GetByID(context.Background(), testAccount.ID, a); err != nil { + if err := suite.db.GetByID(suite.T().Context(), testAccount.ID, a); err != nil { suite.FailNow(err.Error()) } @@ -111,7 +110,7 @@ func (suite *BasicTestSuite) TestPutAccountWithBunDefaultFields() { func (suite *BasicTestSuite) TestGetAllStatuses() { s := []*gtsmodel.Status{} - err := suite.db.GetAll(context.Background(), &s) + err := suite.db.GetAll(suite.T().Context(), &s) suite.NoError(err) suite.Len(s, 30) } @@ -125,7 +124,7 @@ func (suite *BasicTestSuite) TestGetAllNotNull() { a := []*gtsmodel.Account{} - err := suite.db.GetWhere(context.Background(), where, &a) + err := suite.db.GetWhere(suite.T().Context(), where, &a) suite.NoError(err) suite.NotEmpty(a) |
