Skip to content

Commit

Permalink
Add tests for drafts
Browse files Browse the repository at this point in the history
  • Loading branch information
LilSpazJoekp committed Jul 30, 2021
1 parent fd4baa4 commit 6445641
Show file tree
Hide file tree
Showing 10 changed files with 4,987 additions and 0 deletions.
973 changes: 973 additions & 0 deletions tests/integration/cassettes/TestDraft.test_create.json

Large diffs are not rendered by default.

319 changes: 319 additions & 0 deletions tests/integration/cassettes/TestDraft.test_delete.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,319 @@
{
"http_interactions": [
{
"recorded_at": "2021-07-30T00:38:17",
"request": {
"body": {
"encoding": "utf-8",
"string": "grant_type=refresh_token&refresh_token=<REFRESH_TOKEN>"
},
"headers": {
"Accept": [
"*/*"
],
"Accept-Encoding": [
"identity"
],
"Authorization": [
"Basic <BASIC_AUTH>"
],
"Connection": [
"close"
],
"Content-Length": [
"75"
],
"Content-Type": [
"application/x-www-form-urlencoded"
],
"User-Agent": [
"<USER_AGENT> PRAW/7.3.1.dev0 prawcore/2.2.0"
]
},
"method": "POST",
"uri": "https://www.reddit.com/api/v1/access_token"
},
"response": {
"body": {
"encoding": "UTF-8",
"string": "{\"access_token\": \"<ACCESS_TOKEN>\", \"token_type\": \"bearer\", \"expires_in\": 3600, \"refresh_token\": \"<REFRESH_TOKEN>\", \"scope\": \"account creddits edit flair history identity livemanage modconfig modcontributors modflair modlog modmail modothers modposts modself modtraffic modwiki mysubreddits privatemessages read report save structuredstyles submit subscribe vote wikiedit wikiread\"}"
},
"headers": {
"Accept-Ranges": [
"bytes"
],
"Connection": [
"close"
],
"Content-Length": [
"427"
],
"Content-Type": [
"application/json; charset=UTF-8"
],
"Date": [
"Fri, 30 Jul 2021 00:38:17 GMT"
],
"Server": [
"snooserv"
],
"Set-Cookie": [
"edgebucket=Mtb6KzPw9lBS9ddqix; Domain=reddit.com; Max-Age=63071999; Path=/; secure"
],
"Strict-Transport-Security": [
"max-age=15552000; includeSubDomains; preload"
],
"Via": [
"1.1 varnish"
],
"X-Clacks-Overhead": [
"GNU Terry Pratchett"
],
"X-Moose": [
"majestic"
],
"cache-control": [
"max-age=0, must-revalidate"
],
"x-content-type-options": [
"nosniff"
],
"x-frame-options": [
"SAMEORIGIN"
],
"x-ratelimit-remaining": [
"296"
],
"x-ratelimit-reset": [
"103"
],
"x-ratelimit-used": [
"4"
],
"x-xss-protection": [
"1; mode=block"
]
},
"status": {
"code": 200,
"message": "OK"
},
"url": "https://www.reddit.com/api/v1/access_token"
}
},
{
"recorded_at": "2021-07-30T00:38:17",
"request": {
"body": {
"encoding": "utf-8",
"string": ""
},
"headers": {
"Accept": [
"*/*"
],
"Accept-Encoding": [
"identity"
],
"Authorization": [
"bearer <ACCESS_TOKEN>"
],
"Connection": [
"keep-alive"
],
"Content-Length": [
"0"
],
"Cookie": [
"edgebucket=Mtb6KzPw9lBS9ddqix"
],
"User-Agent": [
"<USER_AGENT> PRAW/7.3.1.dev0 prawcore/2.2.0"
]
},
"method": "DELETE",
"uri": "https://oauth.reddit.com/api/v1/draft?draft_id=8f018da6-f0cb-11eb-bac1-aae1fc87c2b4&raw_json=1"
},
"response": {
"body": {
"encoding": "UTF-8",
"string": "{\"json\": {\"errors\": [], \"data\": {\"drafts_count\": 0, \"id\": \"8f018da6-f0cb-11eb-bac1-aae1fc87c2b4\"}}}"
},
"headers": {
"Accept-Ranges": [
"bytes"
],
"Connection": [
"keep-alive"
],
"Content-Length": [
"99"
],
"Content-Type": [
"application/json; charset=UTF-8"
],
"Date": [
"Fri, 30 Jul 2021 00:38:17 GMT"
],
"Server": [
"snooserv"
],
"Strict-Transport-Security": [
"max-age=15552000; includeSubDomains; preload"
],
"Via": [
"1.1 varnish"
],
"X-Clacks-Overhead": [
"GNU Terry Pratchett"
],
"X-Moose": [
"majestic"
],
"cache-control": [
"private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate"
],
"expires": [
"-1"
],
"set-cookie": [
"redesign_optout=true; Domain=reddit.com; Max-Age=94607999; Path=/; expires=Mon, 29-Jul-2024 00:38:17 GMT; secure",
"session_tracker=dokllaijmqciidqlfc.0.1627605497385.Z0FBQUFBQmhBMG41N3o5aFh2eXUtUHZFVTRua2h5T1dQVW95ZmtJUVhZdWVXd2toWVJ4YmpjYTdrU2w0Ulh4VDFNaFpXOTIwdmM5Tk9GcG0wYWRVamhjUmJwNnhtanlfakNwaXYzVHVkbmFzUkpzcktOclpIYU5RMHFPclh3ZlVrdm1WcDZPRklwcUo; Domain=reddit.com; Max-Age=7199; Path=/; expires=Fri, 30-Jul-2021 02:38:17 GMT; secure"
],
"x-content-type-options": [
"nosniff"
],
"x-frame-options": [
"SAMEORIGIN"
],
"x-ratelimit-remaining": [
"123.0"
],
"x-ratelimit-reset": [
"103"
],
"x-ratelimit-used": [
"477"
],
"x-ua-compatible": [
"IE=edge"
],
"x-xss-protection": [
"1; mode=block"
]
},
"status": {
"code": 200,
"message": "OK"
},
"url": "https://oauth.reddit.com/api/v1/draft?draft_id=8f018da6-f0cb-11eb-bac1-aae1fc87c2b4&raw_json=1"
}
},
{
"recorded_at": "2021-07-30T00:38:17",
"request": {
"body": {
"encoding": "utf-8",
"string": ""
},
"headers": {
"Accept": [
"*/*"
],
"Accept-Encoding": [
"identity"
],
"Authorization": [
"bearer <ACCESS_TOKEN>"
],
"Connection": [
"keep-alive"
],
"Cookie": [
"edgebucket=Mtb6KzPw9lBS9ddqix; redesign_optout=true; session_tracker=dokllaijmqciidqlfc.0.1627605497385.Z0FBQUFBQmhBMG41N3o5aFh2eXUtUHZFVTRua2h5T1dQVW95ZmtJUVhZdWVXd2toWVJ4YmpjYTdrU2w0Ulh4VDFNaFpXOTIwdmM5Tk9GcG0wYWRVamhjUmJwNnhtanlfakNwaXYzVHVkbmFzUkpzcktOclpIYU5RMHFPclh3ZlVrdm1WcDZPRklwcUo"
],
"User-Agent": [
"<USER_AGENT> PRAW/7.3.1.dev0 prawcore/2.2.0"
]
},
"method": "GET",
"uri": "https://oauth.reddit.com/api/v1/drafts?md_body=True&raw_json=1"
},
"response": {
"body": {
"encoding": "UTF-8",
"string": "{\"subreddits\": [], \"drafts\": []}"
},
"headers": {
"Accept-Ranges": [
"bytes"
],
"Connection": [
"keep-alive"
],
"Content-Length": [
"32"
],
"Content-Type": [
"application/json; charset=UTF-8"
],
"Date": [
"Fri, 30 Jul 2021 00:38:17 GMT"
],
"Server": [
"snooserv"
],
"Set-Cookie": [
"session_tracker=dokllaijmqciidqlfc.0.1627605497516.Z0FBQUFBQmhBMG41TWhvbzMzTHJoY3czSGQwN1M5UlNrbUUxY1hvY2ExdlFCNnV3Ui0zZzJFSHRCeDM5bjZrSHMxLVh4Y05td2VQd0xwRmp4a0MtTjdxSDl1TkxmNzJVdVNhY05DREFMN2Z5VFhNdDhjbjQ4TjQxbzc3M3VFNUlQSW9OcER4SWpLdTE; Domain=reddit.com; Max-Age=7199; Path=/; expires=Fri, 30-Jul-2021 02:38:17 GMT; secure; SameSite=None; Secure",
"csv=1; Max-Age=63072000; Domain=.reddit.com; Path=/; Secure; SameSite=None"
],
"Strict-Transport-Security": [
"max-age=15552000; includeSubDomains; preload"
],
"Via": [
"1.1 varnish"
],
"X-Clacks-Overhead": [
"GNU Terry Pratchett"
],
"X-Moose": [
"majestic"
],
"cache-control": [
"private, s-maxage=0, max-age=0, must-revalidate, no-store, max-age=0, must-revalidate"
],
"expires": [
"-1"
],
"x-content-type-options": [
"nosniff"
],
"x-frame-options": [
"SAMEORIGIN"
],
"x-ratelimit-remaining": [
"122.0"
],
"x-ratelimit-reset": [
"103"
],
"x-ratelimit-used": [
"478"
],
"x-ua-compatible": [
"IE=edge"
],
"x-xss-protection": [
"1; mode=block"
]
},
"status": {
"code": 200,
"message": "OK"
},
"url": "https://oauth.reddit.com/api/v1/drafts?md_body=True&raw_json=1"
}
}
],
"recorded_with": "betamax/0.8.1"
}
Loading

0 comments on commit 6445641

Please sign in to comment.