diff options
author | 2021-10-04 15:24:19 +0200 | |
---|---|---|
committer | 2021-10-04 15:24:19 +0200 | |
commit | e04b187702acb0c9908237a35b3a9857e2167b3f (patch) | |
tree | 29839b8d5bbc28d34aba759a48dd7b005f1444f5 /internal/api/client/status/statusget_test.go | |
parent | Follow request auto approval (#259) (diff) | |
download | gotosocial-e04b187702acb0c9908237a35b3a9857e2167b3f.tar.xz |
Refactor/tidy (#261)
* tidy up streaming
* cut down code duplication
* test get followers/following
* test streaming processor
* fix some test models
* add TimeMustParse
* fix uri / url typo
* make trace logging less verbose
* make logging more consistent
* disable quote on logging
* remove context.Background
* remove many extraneous mastodon references
* regenerate swagger
* don't log query on no rows result
* log latency first for easier reading
Diffstat (limited to 'internal/api/client/status/statusget_test.go')
-rw-r--r-- | internal/api/client/status/statusget_test.go | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/internal/api/client/status/statusget_test.go b/internal/api/client/status/statusget_test.go index 1c700aaa5..fa5f786cb 100644 --- a/internal/api/client/status/statusget_test.go +++ b/internal/api/client/status/statusget_test.go @@ -57,61 +57,6 @@ func (suite *StatusGetTestSuite) TearDownTest() { testrig.StandardStorageTeardown(suite.storage) } -// Post a new status with some custom visibility settings -func (suite *StatusGetTestSuite) TestPostNewStatus() { - - // t := suite.testTokens["local_account_1"] - // oauthToken := oauth.PGTokenToOauthToken(t) - - // // setup - // recorder := httptest.NewRecorder() - // ctx, _ := gin.CreateTestContext(recorder) - // ctx.Set(oauth.SessionAuthorizedApplication, suite.testApplications["application_1"]) - // ctx.Set(oauth.SessionAuthorizedToken, oauthToken) - // ctx.Set(oauth.SessionAuthorizedUser, suite.testUsers["local_account_1"]) - // ctx.Set(oauth.SessionAuthorizedAccount, suite.testAccounts["local_account_1"]) - // ctx.Request = httptest.NewRequest(http.MethodPost, fmt.Sprintf("http://localhost:8080/%s", basePath), nil) // the endpoint we're hitting - // ctx.Request.Form = url.Values{ - // "status": {"this is a brand new status! #helloworld"}, - // "spoiler_text": {"hello hello"}, - // "sensitive": {"true"}, - // "visibility_advanced": {"mutuals_only"}, - // "likeable": {"false"}, - // "replyable": {"false"}, - // "federated": {"false"}, - // } - // suite.statusModule.statusGETHandler(ctx) - - // // check response - - // // 1. we should have OK from our call to the function - // suite.EqualValues(http.StatusOK, recorder.Code) - - // result := recorder.Result() - // defer result.Body.Close() - // b, err := ioutil.ReadAll(result.Body) - // assert.NoError(suite.T(), err) - - // statusReply := &mastotypes.Status{} - // err = json.Unmarshal(b, statusReply) - // assert.NoError(suite.T(), err) - - // assert.Equal(suite.T(), "hello hello", statusReply.SpoilerText) - // assert.Equal(suite.T(), "this is a brand new status! #helloworld", statusReply.Content) - // assert.True(suite.T(), statusReply.Sensitive) - // assert.Equal(suite.T(), mastotypes.VisibilityPrivate, statusReply.Visibility) - // assert.Len(suite.T(), statusReply.Tags, 1) - // assert.Equal(suite.T(), mastotypes.Tag{ - // Name: "helloworld", - // URL: "http://localhost:8080/tags/helloworld", - // }, statusReply.Tags[0]) - - // gtsTag := >smodel.Tag{} - // err = suite.db.GetWhere("name", "helloworld", gtsTag) - // assert.NoError(suite.T(), err) - // assert.Equal(suite.T(), statusReply.Account.ID, gtsTag.FirstSeenFromAccountID) -} - func TestStatusGetTestSuite(t *testing.T) { suite.Run(t, new(StatusGetTestSuite)) } |