-
-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] Remove omitempty on account source; refactor tests to use pre…
…ttyprint json (#1337) * remove omitEmpty tag on account source items * update tests
- Loading branch information
1 parent
5318054
commit eafd73c
Showing
18 changed files
with
1,611 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,9 @@ | |
package followrequests_test | ||
|
||
import ( | ||
"bytes" | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"net/http" | ||
|
@@ -69,8 +71,32 @@ func (suite *GetTestSuite) TestGet() { | |
// check the response | ||
b, err := ioutil.ReadAll(result.Body) | ||
assert.NoError(suite.T(), err) | ||
|
||
suite.Equal(`[{"id":"01FHMQX3GAABWSM0S2VZEC2SWC","username":"Some_User","acct":"[email protected]","display_name":"some user","locked":true,"bot":false,"created_at":"2020-08-10T12:13:28.000Z","note":"i'm a real son of a gun","url":"http://example.org/@Some_User","avatar":"","avatar_static":"","header":"http://localhost:8080/assets/default_header.png","header_static":"http://localhost:8080/assets/default_header.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"emojis":[],"fields":[]}]`, string(b)) | ||
dst := new(bytes.Buffer) | ||
err = json.Indent(dst, b, "", " ") | ||
suite.NoError(err) | ||
suite.Equal(`[ | ||
{ | ||
"id": "01FHMQX3GAABWSM0S2VZEC2SWC", | ||
"username": "Some_User", | ||
"acct": "[email protected]", | ||
"display_name": "some user", | ||
"locked": true, | ||
"bot": false, | ||
"created_at": "2020-08-10T12:13:28.000Z", | ||
"note": "i'm a real son of a gun", | ||
"url": "http://example.org/@Some_User", | ||
"avatar": "", | ||
"avatar_static": "", | ||
"header": "http://localhost:8080/assets/default_header.png", | ||
"header_static": "http://localhost:8080/assets/default_header.png", | ||
"followers_count": 0, | ||
"following_count": 0, | ||
"statuses_count": 0, | ||
"last_status_at": null, | ||
"emojis": [], | ||
"fields": [] | ||
} | ||
]`, dst.String()) | ||
} | ||
|
||
func TestGetTestSuite(t *testing.T) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.