mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 05:22:24 -05:00
[chore/bugfix/horror] Allow expires_in and poll choices to be parsed from strings (#2346)
This commit is contained in:
parent
7ce3a1e6f3
commit
c7ecab9e6f
14 changed files with 579 additions and 194 deletions
|
|
@ -160,9 +160,9 @@ func (suite *MediaCreateTestSuite) TestMediaCreateSuccessful() {
|
|||
}
|
||||
|
||||
// create the request
|
||||
buf, w, err := testrig.CreateMultipartFormData("file", "../../../../testrig/media/test-jpeg.jpg", map[string]string{
|
||||
"description": "this is a test image -- a cool background from somewhere",
|
||||
"focus": "-0.5,0.5",
|
||||
buf, w, err := testrig.CreateMultipartFormData("file", "../../../../testrig/media/test-jpeg.jpg", map[string][]string{
|
||||
"description": {"this is a test image -- a cool background from somewhere"},
|
||||
"focus": {"-0.5,0.5"},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
@ -245,9 +245,9 @@ func (suite *MediaCreateTestSuite) TestMediaCreateSuccessfulV2() {
|
|||
}
|
||||
|
||||
// create the request
|
||||
buf, w, err := testrig.CreateMultipartFormData("file", "../../../../testrig/media/test-jpeg.jpg", map[string]string{
|
||||
"description": "this is a test image -- a cool background from somewhere",
|
||||
"focus": "-0.5,0.5",
|
||||
buf, w, err := testrig.CreateMultipartFormData("file", "../../../../testrig/media/test-jpeg.jpg", map[string][]string{
|
||||
"description": {"this is a test image -- a cool background from somewhere"},
|
||||
"focus": {"-0.5,0.5"},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
@ -328,9 +328,9 @@ func (suite *MediaCreateTestSuite) TestMediaCreateLongDescription() {
|
|||
description := base64.RawStdEncoding.EncodeToString(descriptionBytes)
|
||||
|
||||
// create the request
|
||||
buf, w, err := testrig.CreateMultipartFormData("file", "../../../../testrig/media/test-jpeg.jpg", map[string]string{
|
||||
"description": description,
|
||||
"focus": "-0.5,0.5",
|
||||
buf, w, err := testrig.CreateMultipartFormData("file", "../../../../testrig/media/test-jpeg.jpg", map[string][]string{
|
||||
"description": {description},
|
||||
"focus": {"-0.5,0.5"},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
@ -369,9 +369,9 @@ func (suite *MediaCreateTestSuite) TestMediaCreateTooShortDescription() {
|
|||
ctx.Set(oauth.SessionAuthorizedAccount, suite.testAccounts["local_account_1"])
|
||||
|
||||
// create the request
|
||||
buf, w, err := testrig.CreateMultipartFormData("file", "../../../../testrig/media/test-jpeg.jpg", map[string]string{
|
||||
"description": "", // provide an empty description
|
||||
"focus": "-0.5,0.5",
|
||||
buf, w, err := testrig.CreateMultipartFormData("file", "../../../../testrig/media/test-jpeg.jpg", map[string][]string{
|
||||
"description": {""}, // provide an empty description
|
||||
"focus": {"-0.5,0.5"},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
|
|||
|
|
@ -149,10 +149,10 @@ func (suite *MediaUpdateTestSuite) TestUpdateImage() {
|
|||
ctx.Set(oauth.SessionAuthorizedAccount, suite.testAccounts["local_account_1"])
|
||||
|
||||
// create the request
|
||||
buf, w, err := testrig.CreateMultipartFormData("", "", map[string]string{
|
||||
"id": toUpdate.ID,
|
||||
"description": "new description!",
|
||||
"focus": "-0.1,0.3",
|
||||
buf, w, err := testrig.CreateMultipartFormData("", "", map[string][]string{
|
||||
"id": {toUpdate.ID},
|
||||
"description": {"new description!"},
|
||||
"focus": {"-0.1,0.3"},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
@ -210,10 +210,10 @@ func (suite *MediaUpdateTestSuite) TestUpdateImageShortDescription() {
|
|||
ctx.Set(oauth.SessionAuthorizedAccount, suite.testAccounts["local_account_1"])
|
||||
|
||||
// create the request
|
||||
buf, w, err := testrig.CreateMultipartFormData("", "", map[string]string{
|
||||
"id": toUpdate.ID,
|
||||
"description": "new description!",
|
||||
"focus": "-0.1,0.3",
|
||||
buf, w, err := testrig.CreateMultipartFormData("", "", map[string][]string{
|
||||
"id": {toUpdate.ID},
|
||||
"description": {"new description!"},
|
||||
"focus": {"-0.1,0.3"},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue