diff options
author | codl <[email protected]> | 2017-11-27 22:52:19 +0100 |
---|---|---|
committer | codl <[email protected]> | 2017-11-27 22:52:19 +0100 |
commit | c73fd26729e8266374bc89f50cae5c429bf6122e (patch) | |
tree | 698a340e691aa236ba1eed94971594762bdd2e56 | |
parent | 26eb1004bba411345b8f8bb1beb72b6a9efbb954 (diff) | |
download | mastodon.py-c73fd26729e8266374bc89f50cae5c429bf6122e.tar.gz |
add tests for writing statuses
-rw-r--r-- | tests/cassettes/test_status_fav_unfav.yaml | 113 | ||||
-rw-r--r-- | tests/cassettes/test_status_mute_unmute.yaml | 113 | ||||
-rw-r--r-- | tests/cassettes/test_status_post[Content warning-direct].yaml | 58 | ||||
-rw-r--r-- | tests/cassettes/test_status_post[Content warning-private].yaml | 58 | ||||
-rw-r--r-- | tests/cassettes/test_status_post[Content warning-public].yaml | 58 | ||||
-rw-r--r-- | tests/cassettes/test_status_post[Content warning-unlisted].yaml | 58 | ||||
-rw-r--r-- | tests/cassettes/test_status_post[Content warning].yaml | 58 | ||||
-rw-r--r-- | tests/cassettes/test_status_post[None-direct].yaml | 57 | ||||
-rw-r--r-- | tests/cassettes/test_status_post[None-private].yaml | 57 | ||||
-rw-r--r-- | tests/cassettes/test_status_post[None-public].yaml | 57 | ||||
-rw-r--r-- | tests/cassettes/test_status_post[None-unlisted].yaml | 57 | ||||
-rw-r--r-- | tests/cassettes/test_status_post[None].yaml | 57 | ||||
-rw-r--r-- | tests/cassettes/test_status_reblog_unreblog.yaml | 117 | ||||
-rw-r--r-- | tests/cassettes/test_toot.yaml | 57 | ||||
-rw-r--r-- | tests/test_status.py | 56 |
15 files changed, 1031 insertions, 0 deletions
diff --git a/tests/cassettes/test_status_fav_unfav.yaml b/tests/cassettes/test_status_fav_unfav.yaml new file mode 100644 index 0000000..2e08744 --- /dev/null +++ b/tests/cassettes/test_status_fav_unfav.yaml | |||
@@ -0,0 +1,113 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: visibility=&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['26'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078586530021605","created_at":"2017-11-27T21:47:32.477Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078586530021605","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078586530021605","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
16 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
17 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
18 | headers: | ||
19 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
20 | Content-Type: [application/json; charset=utf-8] | ||
21 | ETag: [W/"ba63e0f1a3e8e12e6243b41926314f97"] | ||
22 | Transfer-Encoding: [chunked] | ||
23 | Vary: ['Accept-Encoding, Origin'] | ||
24 | X-Content-Type-Options: [nosniff] | ||
25 | X-Frame-Options: [SAMEORIGIN] | ||
26 | X-Request-Id: [142e9563-ee50-487e-94b6-1a4a5766908b] | ||
27 | X-Runtime: ['0.074122'] | ||
28 | X-XSS-Protection: [1; mode=block] | ||
29 | content-length: ['1216'] | ||
30 | status: {code: 200, message: OK} | ||
31 | - request: | ||
32 | body: null | ||
33 | headers: | ||
34 | Accept: ['*/*'] | ||
35 | Accept-Encoding: ['gzip, deflate'] | ||
36 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
37 | Connection: [keep-alive] | ||
38 | Content-Length: ['0'] | ||
39 | User-Agent: [python-requests/2.18.4] | ||
40 | method: POST | ||
41 | uri: http://localhost:3000/api/v1/statuses/99078586530021605/favourite | ||
42 | response: | ||
43 | body: {string: '{"id":"99078586530021605","created_at":"2017-11-27T21:47:32.477Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078586530021605","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078586530021605","reblogs_count":0,"favourites_count":1,"favourited":true,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
44 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
45 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
46 | headers: | ||
47 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
48 | Content-Type: [application/json; charset=utf-8] | ||
49 | ETag: [W/"3a3d285f078337a7e2e3311b19094468"] | ||
50 | Transfer-Encoding: [chunked] | ||
51 | Vary: ['Accept-Encoding, Origin'] | ||
52 | X-Content-Type-Options: [nosniff] | ||
53 | X-Frame-Options: [SAMEORIGIN] | ||
54 | X-Request-Id: [c59316bc-2534-40b4-bf54-3cc561bf42f6] | ||
55 | X-Runtime: ['0.062361'] | ||
56 | X-XSS-Protection: [1; mode=block] | ||
57 | content-length: ['1215'] | ||
58 | status: {code: 200, message: OK} | ||
59 | - request: | ||
60 | body: null | ||
61 | headers: | ||
62 | Accept: ['*/*'] | ||
63 | Accept-Encoding: ['gzip, deflate'] | ||
64 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
65 | Connection: [keep-alive] | ||
66 | Content-Length: ['0'] | ||
67 | User-Agent: [python-requests/2.18.4] | ||
68 | method: POST | ||
69 | uri: http://localhost:3000/api/v1/statuses/99078586530021605/unfavourite | ||
70 | response: | ||
71 | body: {string: '{"id":"99078586530021605","created_at":"2017-11-27T21:47:32.477Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078586530021605","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078586530021605","reblogs_count":0,"favourites_count":1,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
72 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
73 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
74 | headers: | ||
75 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
76 | Content-Type: [application/json; charset=utf-8] | ||
77 | ETag: [W/"64604daf01ed974c75cf8c75665da2e9"] | ||
78 | Transfer-Encoding: [chunked] | ||
79 | Vary: ['Accept-Encoding, Origin'] | ||
80 | X-Content-Type-Options: [nosniff] | ||
81 | X-Frame-Options: [SAMEORIGIN] | ||
82 | X-Request-Id: [28a00b16-7394-4515-b3d3-deefa916edd7] | ||
83 | X-Runtime: ['0.045170'] | ||
84 | X-XSS-Protection: [1; mode=block] | ||
85 | content-length: ['1216'] | ||
86 | status: {code: 200, message: OK} | ||
87 | - request: | ||
88 | body: null | ||
89 | headers: | ||
90 | Accept: ['*/*'] | ||
91 | Accept-Encoding: ['gzip, deflate'] | ||
92 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
93 | Connection: [keep-alive] | ||
94 | Content-Length: ['0'] | ||
95 | User-Agent: [python-requests/2.18.4] | ||
96 | method: DELETE | ||
97 | uri: http://localhost:3000/api/v1/statuses/99078586530021605 | ||
98 | response: | ||
99 | body: {string: '{}'} | ||
100 | headers: | ||
101 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
102 | Content-Type: [application/json; charset=utf-8] | ||
103 | ETag: [W/"bacdf987b5660522964c5adce48ab274"] | ||
104 | Transfer-Encoding: [chunked] | ||
105 | Vary: ['Accept-Encoding, Origin'] | ||
106 | X-Content-Type-Options: [nosniff] | ||
107 | X-Frame-Options: [SAMEORIGIN] | ||
108 | X-Request-Id: [14f33b8c-ba10-4be2-bbe5-fafa6128471b] | ||
109 | X-Runtime: ['0.022232'] | ||
110 | X-XSS-Protection: [1; mode=block] | ||
111 | content-length: ['2'] | ||
112 | status: {code: 200, message: OK} | ||
113 | version: 1 | ||
diff --git a/tests/cassettes/test_status_mute_unmute.yaml b/tests/cassettes/test_status_mute_unmute.yaml new file mode 100644 index 0000000..53dc79b --- /dev/null +++ b/tests/cassettes/test_status_mute_unmute.yaml | |||
@@ -0,0 +1,113 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: visibility=&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['26'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078602528624487","created_at":"2017-11-27T21:51:36.599Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078602528624487","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078602528624487","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
16 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
17 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
18 | headers: | ||
19 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
20 | Content-Type: [application/json; charset=utf-8] | ||
21 | ETag: [W/"587ac5b3c9e247979cb93a70c1321328"] | ||
22 | Transfer-Encoding: [chunked] | ||
23 | Vary: ['Accept-Encoding, Origin'] | ||
24 | X-Content-Type-Options: [nosniff] | ||
25 | X-Frame-Options: [SAMEORIGIN] | ||
26 | X-Request-Id: [129e95ff-57fa-4b79-9d95-8f40d2f74d06] | ||
27 | X-Runtime: ['0.058771'] | ||
28 | X-XSS-Protection: [1; mode=block] | ||
29 | content-length: ['1216'] | ||
30 | status: {code: 200, message: OK} | ||
31 | - request: | ||
32 | body: null | ||
33 | headers: | ||
34 | Accept: ['*/*'] | ||
35 | Accept-Encoding: ['gzip, deflate'] | ||
36 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
37 | Connection: [keep-alive] | ||
38 | Content-Length: ['0'] | ||
39 | User-Agent: [python-requests/2.18.4] | ||
40 | method: POST | ||
41 | uri: http://localhost:3000/api/v1/statuses/99078602528624487/mute | ||
42 | response: | ||
43 | body: {string: '{"id":"99078602528624487","created_at":"2017-11-27T21:51:36.599Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078602528624487","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078602528624487","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":true,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
44 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
45 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
46 | headers: | ||
47 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
48 | Content-Type: [application/json; charset=utf-8] | ||
49 | ETag: [W/"cba613b7907e3005179e695cefdb271c"] | ||
50 | Transfer-Encoding: [chunked] | ||
51 | Vary: ['Accept-Encoding, Origin'] | ||
52 | X-Content-Type-Options: [nosniff] | ||
53 | X-Frame-Options: [SAMEORIGIN] | ||
54 | X-Request-Id: [fe40452a-4726-4925-9f6f-b1ebb9236760] | ||
55 | X-Runtime: ['0.069400'] | ||
56 | X-XSS-Protection: [1; mode=block] | ||
57 | content-length: ['1215'] | ||
58 | status: {code: 200, message: OK} | ||
59 | - request: | ||
60 | body: null | ||
61 | headers: | ||
62 | Accept: ['*/*'] | ||
63 | Accept-Encoding: ['gzip, deflate'] | ||
64 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
65 | Connection: [keep-alive] | ||
66 | Content-Length: ['0'] | ||
67 | User-Agent: [python-requests/2.18.4] | ||
68 | method: POST | ||
69 | uri: http://localhost:3000/api/v1/statuses/99078602528624487/unmute | ||
70 | response: | ||
71 | body: {string: '{"id":"99078602528624487","created_at":"2017-11-27T21:51:36.599Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078602528624487","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078602528624487","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
72 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
73 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
74 | headers: | ||
75 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
76 | Content-Type: [application/json; charset=utf-8] | ||
77 | ETag: [W/"587ac5b3c9e247979cb93a70c1321328"] | ||
78 | Transfer-Encoding: [chunked] | ||
79 | Vary: ['Accept-Encoding, Origin'] | ||
80 | X-Content-Type-Options: [nosniff] | ||
81 | X-Frame-Options: [SAMEORIGIN] | ||
82 | X-Request-Id: [7c082341-b3f2-432a-848e-44e4a343bb75] | ||
83 | X-Runtime: ['0.071155'] | ||
84 | X-XSS-Protection: [1; mode=block] | ||
85 | content-length: ['1216'] | ||
86 | status: {code: 200, message: OK} | ||
87 | - request: | ||
88 | body: null | ||
89 | headers: | ||
90 | Accept: ['*/*'] | ||
91 | Accept-Encoding: ['gzip, deflate'] | ||
92 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
93 | Connection: [keep-alive] | ||
94 | Content-Length: ['0'] | ||
95 | User-Agent: [python-requests/2.18.4] | ||
96 | method: DELETE | ||
97 | uri: http://localhost:3000/api/v1/statuses/99078602528624487 | ||
98 | response: | ||
99 | body: {string: '{}'} | ||
100 | headers: | ||
101 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
102 | Content-Type: [application/json; charset=utf-8] | ||
103 | ETag: [W/"e7d76440082320bd78d556c907de0f9b"] | ||
104 | Transfer-Encoding: [chunked] | ||
105 | Vary: ['Accept-Encoding, Origin'] | ||
106 | X-Content-Type-Options: [nosniff] | ||
107 | X-Frame-Options: [SAMEORIGIN] | ||
108 | X-Request-Id: [29ac5b89-ac6f-41de-b554-9bbdd44d804d] | ||
109 | X-Runtime: ['0.018463'] | ||
110 | X-XSS-Protection: [1; mode=block] | ||
111 | content-length: ['2'] | ||
112 | status: {code: 200, message: OK} | ||
113 | version: 1 | ||
diff --git a/tests/cassettes/test_status_post[Content warning-direct].yaml b/tests/cassettes/test_status_post[Content warning-direct].yaml new file mode 100644 index 0000000..de9857a --- /dev/null +++ b/tests/cassettes/test_status_post[Content warning-direct].yaml | |||
@@ -0,0 +1,58 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: spoiler_text=Content+warning&visibility=direct&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['61'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078538760892804","created_at":"2017-11-27T21:35:23.602Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":true,"spoiler_text":"Content | ||
16 | warning","visibility":"direct","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078538760892804","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078538760892804","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"reblog":null,"application":{"name":"Mastodon.py | ||
17 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
18 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
19 | headers: | ||
20 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
21 | Content-Type: [application/json; charset=utf-8] | ||
22 | ETag: [W/"faebb19c30c9884fcc4ea869f202de90"] | ||
23 | Transfer-Encoding: [chunked] | ||
24 | Vary: ['Accept-Encoding, Origin'] | ||
25 | X-Content-Type-Options: [nosniff] | ||
26 | X-Frame-Options: [SAMEORIGIN] | ||
27 | X-Request-Id: [af56e751-efba-4591-b6d7-20747db81e31] | ||
28 | X-Runtime: ['0.155059'] | ||
29 | X-XSS-Protection: [1; mode=block] | ||
30 | content-length: ['1215'] | ||
31 | status: {code: 200, message: OK} | ||
32 | - request: | ||
33 | body: null | ||
34 | headers: | ||
35 | Accept: ['*/*'] | ||
36 | Accept-Encoding: ['gzip, deflate'] | ||
37 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
38 | Connection: [keep-alive] | ||
39 | Content-Length: ['0'] | ||
40 | User-Agent: [python-requests/2.18.4] | ||
41 | method: DELETE | ||
42 | uri: http://localhost:3000/api/v1/statuses/99078538760892804 | ||
43 | response: | ||
44 | body: {string: '{}'} | ||
45 | headers: | ||
46 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
47 | Content-Type: [application/json; charset=utf-8] | ||
48 | ETag: [W/"f7fc33915846d26da15c0f1b7a4a278c"] | ||
49 | Transfer-Encoding: [chunked] | ||
50 | Vary: ['Accept-Encoding, Origin'] | ||
51 | X-Content-Type-Options: [nosniff] | ||
52 | X-Frame-Options: [SAMEORIGIN] | ||
53 | X-Request-Id: [f119027a-989d-4984-97ff-921c509f5d9e] | ||
54 | X-Runtime: ['0.034255'] | ||
55 | X-XSS-Protection: [1; mode=block] | ||
56 | content-length: ['2'] | ||
57 | status: {code: 200, message: OK} | ||
58 | version: 1 | ||
diff --git a/tests/cassettes/test_status_post[Content warning-private].yaml b/tests/cassettes/test_status_post[Content warning-private].yaml new file mode 100644 index 0000000..290093b --- /dev/null +++ b/tests/cassettes/test_status_post[Content warning-private].yaml | |||
@@ -0,0 +1,58 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: spoiler_text=Content+warning&visibility=private&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['62'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078538778069470","created_at":"2017-11-27T21:35:23.849Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":true,"spoiler_text":"Content | ||
16 | warning","visibility":"private","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078538778069470","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078538778069470","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"reblog":null,"application":{"name":"Mastodon.py | ||
17 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
18 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":40},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
19 | headers: | ||
20 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
21 | Content-Type: [application/json; charset=utf-8] | ||
22 | ETag: [W/"1c38bf8fe70fe3978f73b3cd4f7ef616"] | ||
23 | Transfer-Encoding: [chunked] | ||
24 | Vary: ['Accept-Encoding, Origin'] | ||
25 | X-Content-Type-Options: [nosniff] | ||
26 | X-Frame-Options: [SAMEORIGIN] | ||
27 | X-Request-Id: [2ba1ac00-f419-4553-a37d-9ba0b6ffaf04] | ||
28 | X-Runtime: ['0.091223'] | ||
29 | X-XSS-Protection: [1; mode=block] | ||
30 | content-length: ['1216'] | ||
31 | status: {code: 200, message: OK} | ||
32 | - request: | ||
33 | body: null | ||
34 | headers: | ||
35 | Accept: ['*/*'] | ||
36 | Accept-Encoding: ['gzip, deflate'] | ||
37 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
38 | Connection: [keep-alive] | ||
39 | Content-Length: ['0'] | ||
40 | User-Agent: [python-requests/2.18.4] | ||
41 | method: DELETE | ||
42 | uri: http://localhost:3000/api/v1/statuses/99078538778069470 | ||
43 | response: | ||
44 | body: {string: '{}'} | ||
45 | headers: | ||
46 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
47 | Content-Type: [application/json; charset=utf-8] | ||
48 | ETag: [W/"f7fc33915846d26da15c0f1b7a4a278c"] | ||
49 | Transfer-Encoding: [chunked] | ||
50 | Vary: ['Accept-Encoding, Origin'] | ||
51 | X-Content-Type-Options: [nosniff] | ||
52 | X-Frame-Options: [SAMEORIGIN] | ||
53 | X-Request-Id: [d511161c-2fba-4fd8-86b5-0301c0668b7f] | ||
54 | X-Runtime: ['0.039124'] | ||
55 | X-XSS-Protection: [1; mode=block] | ||
56 | content-length: ['2'] | ||
57 | status: {code: 200, message: OK} | ||
58 | version: 1 | ||
diff --git a/tests/cassettes/test_status_post[Content warning-public].yaml b/tests/cassettes/test_status_post[Content warning-public].yaml new file mode 100644 index 0000000..cf3c5ab --- /dev/null +++ b/tests/cassettes/test_status_post[Content warning-public].yaml | |||
@@ -0,0 +1,58 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: spoiler_text=Content+warning&visibility=public&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['61'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078538813976033","created_at":"2017-11-27T21:35:24.403Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":true,"spoiler_text":"Content | ||
16 | warning","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078538813976033","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078538813976033","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
17 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
18 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
19 | headers: | ||
20 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
21 | Content-Type: [application/json; charset=utf-8] | ||
22 | ETag: [W/"54694161764cd1f46be0f698454485a6"] | ||
23 | Transfer-Encoding: [chunked] | ||
24 | Vary: ['Accept-Encoding, Origin'] | ||
25 | X-Content-Type-Options: [nosniff] | ||
26 | X-Frame-Options: [SAMEORIGIN] | ||
27 | X-Request-Id: [58972296-af72-490e-82ab-737a248e2c93] | ||
28 | X-Runtime: ['0.133806'] | ||
29 | X-XSS-Protection: [1; mode=block] | ||
30 | content-length: ['1230'] | ||
31 | status: {code: 200, message: OK} | ||
32 | - request: | ||
33 | body: null | ||
34 | headers: | ||
35 | Accept: ['*/*'] | ||
36 | Accept-Encoding: ['gzip, deflate'] | ||
37 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
38 | Connection: [keep-alive] | ||
39 | Content-Length: ['0'] | ||
40 | User-Agent: [python-requests/2.18.4] | ||
41 | method: DELETE | ||
42 | uri: http://localhost:3000/api/v1/statuses/99078538813976033 | ||
43 | response: | ||
44 | body: {string: '{}'} | ||
45 | headers: | ||
46 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
47 | Content-Type: [application/json; charset=utf-8] | ||
48 | ETag: [W/"281b1437417f3c36425fb4391d51fdd8"] | ||
49 | Transfer-Encoding: [chunked] | ||
50 | Vary: ['Accept-Encoding, Origin'] | ||
51 | X-Content-Type-Options: [nosniff] | ||
52 | X-Frame-Options: [SAMEORIGIN] | ||
53 | X-Request-Id: [96e8708d-d214-4af6-992f-2f85c969f342] | ||
54 | X-Runtime: ['0.045929'] | ||
55 | X-XSS-Protection: [1; mode=block] | ||
56 | content-length: ['2'] | ||
57 | status: {code: 200, message: OK} | ||
58 | version: 1 | ||
diff --git a/tests/cassettes/test_status_post[Content warning-unlisted].yaml b/tests/cassettes/test_status_post[Content warning-unlisted].yaml new file mode 100644 index 0000000..c328894 --- /dev/null +++ b/tests/cassettes/test_status_post[Content warning-unlisted].yaml | |||
@@ -0,0 +1,58 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: spoiler_text=Content+warning&visibility=unlisted&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['63'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078538794765957","created_at":"2017-11-27T21:35:24.122Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":true,"spoiler_text":"Content | ||
16 | warning","visibility":"unlisted","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078538794765957","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078538794765957","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
17 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
18 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":40},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
19 | headers: | ||
20 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
21 | Content-Type: [application/json; charset=utf-8] | ||
22 | ETag: [W/"78ed85c02250792a65b294f11b297643"] | ||
23 | Transfer-Encoding: [chunked] | ||
24 | Vary: ['Accept-Encoding, Origin'] | ||
25 | X-Content-Type-Options: [nosniff] | ||
26 | X-Frame-Options: [SAMEORIGIN] | ||
27 | X-Request-Id: [c7a2193e-80bd-4303-9a03-63f9892e10c7] | ||
28 | X-Runtime: ['0.150372'] | ||
29 | X-XSS-Protection: [1; mode=block] | ||
30 | content-length: ['1232'] | ||
31 | status: {code: 200, message: OK} | ||
32 | - request: | ||
33 | body: null | ||
34 | headers: | ||
35 | Accept: ['*/*'] | ||
36 | Accept-Encoding: ['gzip, deflate'] | ||
37 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
38 | Connection: [keep-alive] | ||
39 | Content-Length: ['0'] | ||
40 | User-Agent: [python-requests/2.18.4] | ||
41 | method: DELETE | ||
42 | uri: http://localhost:3000/api/v1/statuses/99078538794765957 | ||
43 | response: | ||
44 | body: {string: '{}'} | ||
45 | headers: | ||
46 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
47 | Content-Type: [application/json; charset=utf-8] | ||
48 | ETag: [W/"281b1437417f3c36425fb4391d51fdd8"] | ||
49 | Transfer-Encoding: [chunked] | ||
50 | Vary: ['Accept-Encoding, Origin'] | ||
51 | X-Content-Type-Options: [nosniff] | ||
52 | X-Frame-Options: [SAMEORIGIN] | ||
53 | X-Request-Id: [b1ba1e5d-9cd6-42db-86ed-623dbc0c2df7] | ||
54 | X-Runtime: ['0.049317'] | ||
55 | X-XSS-Protection: [1; mode=block] | ||
56 | content-length: ['2'] | ||
57 | status: {code: 200, message: OK} | ||
58 | version: 1 | ||
diff --git a/tests/cassettes/test_status_post[Content warning].yaml b/tests/cassettes/test_status_post[Content warning].yaml new file mode 100644 index 0000000..1b62ffa --- /dev/null +++ b/tests/cassettes/test_status_post[Content warning].yaml | |||
@@ -0,0 +1,58 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: spoiler_text=Content+warning&visibility=&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['55'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078538748907806","created_at":"2017-11-27T21:35:23.412Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":true,"spoiler_text":"Content | ||
16 | warning","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078538748907806","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078538748907806","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
17 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
18 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
19 | headers: | ||
20 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
21 | Content-Type: [application/json; charset=utf-8] | ||
22 | ETag: [W/"842f62d44730b0d32fe472186965ca79"] | ||
23 | Transfer-Encoding: [chunked] | ||
24 | Vary: ['Accept-Encoding, Origin'] | ||
25 | X-Content-Type-Options: [nosniff] | ||
26 | X-Frame-Options: [SAMEORIGIN] | ||
27 | X-Request-Id: [2cb55661-0b6c-4136-8bdf-6667beb140d7] | ||
28 | X-Runtime: ['0.108175'] | ||
29 | X-XSS-Protection: [1; mode=block] | ||
30 | content-length: ['1230'] | ||
31 | status: {code: 200, message: OK} | ||
32 | - request: | ||
33 | body: null | ||
34 | headers: | ||
35 | Accept: ['*/*'] | ||
36 | Accept-Encoding: ['gzip, deflate'] | ||
37 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
38 | Connection: [keep-alive] | ||
39 | Content-Length: ['0'] | ||
40 | User-Agent: [python-requests/2.18.4] | ||
41 | method: DELETE | ||
42 | uri: http://localhost:3000/api/v1/statuses/99078538748907806 | ||
43 | response: | ||
44 | body: {string: '{}'} | ||
45 | headers: | ||
46 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
47 | Content-Type: [application/json; charset=utf-8] | ||
48 | ETag: [W/"f7fc33915846d26da15c0f1b7a4a278c"] | ||
49 | Transfer-Encoding: [chunked] | ||
50 | Vary: ['Accept-Encoding, Origin'] | ||
51 | X-Content-Type-Options: [nosniff] | ||
52 | X-Frame-Options: [SAMEORIGIN] | ||
53 | X-Request-Id: [6f7f68e5-396b-4f1b-b7fe-08db594feb18] | ||
54 | X-Runtime: ['0.023226'] | ||
55 | X-XSS-Protection: [1; mode=block] | ||
56 | content-length: ['2'] | ||
57 | status: {code: 200, message: OK} | ||
58 | version: 1 | ||
diff --git a/tests/cassettes/test_status_post[None-direct].yaml b/tests/cassettes/test_status_post[None-direct].yaml new file mode 100644 index 0000000..8ebf6e9 --- /dev/null +++ b/tests/cassettes/test_status_post[None-direct].yaml | |||
@@ -0,0 +1,57 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: visibility=direct&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['32'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078538678016976","created_at":"2017-11-27T21:35:22.316Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"direct","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078538678016976","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078538678016976","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"reblog":null,"application":{"name":"Mastodon.py | ||
16 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
17 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
18 | headers: | ||
19 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
20 | Content-Type: [application/json; charset=utf-8] | ||
21 | ETag: [W/"35f8294317f2cd55325490b6469a16d4"] | ||
22 | Transfer-Encoding: [chunked] | ||
23 | Vary: ['Accept-Encoding, Origin'] | ||
24 | X-Content-Type-Options: [nosniff] | ||
25 | X-Frame-Options: [SAMEORIGIN] | ||
26 | X-Request-Id: [30a825eb-d7a6-475e-ad46-c07e23382332] | ||
27 | X-Runtime: ['0.073877'] | ||
28 | X-XSS-Protection: [1; mode=block] | ||
29 | content-length: ['1201'] | ||
30 | status: {code: 200, message: OK} | ||
31 | - request: | ||
32 | body: null | ||
33 | headers: | ||
34 | Accept: ['*/*'] | ||
35 | Accept-Encoding: ['gzip, deflate'] | ||
36 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
37 | Connection: [keep-alive] | ||
38 | Content-Length: ['0'] | ||
39 | User-Agent: [python-requests/2.18.4] | ||
40 | method: DELETE | ||
41 | uri: http://localhost:3000/api/v1/statuses/99078538678016976 | ||
42 | response: | ||
43 | body: {string: '{}'} | ||
44 | headers: | ||
45 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
46 | Content-Type: [application/json; charset=utf-8] | ||
47 | ETag: [W/"7548ec7d845d6af32286d2251f2c0387"] | ||
48 | Transfer-Encoding: [chunked] | ||
49 | Vary: ['Accept-Encoding, Origin'] | ||
50 | X-Content-Type-Options: [nosniff] | ||
51 | X-Frame-Options: [SAMEORIGIN] | ||
52 | X-Request-Id: [aced08b3-d677-4d98-81ac-f7f1f2e612fa] | ||
53 | X-Runtime: ['0.026984'] | ||
54 | X-XSS-Protection: [1; mode=block] | ||
55 | content-length: ['2'] | ||
56 | status: {code: 200, message: OK} | ||
57 | version: 1 | ||
diff --git a/tests/cassettes/test_status_post[None-private].yaml b/tests/cassettes/test_status_post[None-private].yaml new file mode 100644 index 0000000..e810bb4 --- /dev/null +++ b/tests/cassettes/test_status_post[None-private].yaml | |||
@@ -0,0 +1,57 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: visibility=private&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['33'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078538689653170","created_at":"2017-11-27T21:35:22.496Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"private","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078538689653170","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078538689653170","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"reblog":null,"application":{"name":"Mastodon.py | ||
16 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
17 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":40},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
18 | headers: | ||
19 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
20 | Content-Type: [application/json; charset=utf-8] | ||
21 | ETag: [W/"235cd40123ef22016ae5e38ceb50a7c7"] | ||
22 | Transfer-Encoding: [chunked] | ||
23 | Vary: ['Accept-Encoding, Origin'] | ||
24 | X-Content-Type-Options: [nosniff] | ||
25 | X-Frame-Options: [SAMEORIGIN] | ||
26 | X-Request-Id: [c12fa818-1403-400b-837d-cffcacc7ba7a] | ||
27 | X-Runtime: ['0.087335'] | ||
28 | X-XSS-Protection: [1; mode=block] | ||
29 | content-length: ['1202'] | ||
30 | status: {code: 200, message: OK} | ||
31 | - request: | ||
32 | body: null | ||
33 | headers: | ||
34 | Accept: ['*/*'] | ||
35 | Accept-Encoding: ['gzip, deflate'] | ||
36 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
37 | Connection: [keep-alive] | ||
38 | Content-Length: ['0'] | ||
39 | User-Agent: [python-requests/2.18.4] | ||
40 | method: DELETE | ||
41 | uri: http://localhost:3000/api/v1/statuses/99078538689653170 | ||
42 | response: | ||
43 | body: {string: '{}'} | ||
44 | headers: | ||
45 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
46 | Content-Type: [application/json; charset=utf-8] | ||
47 | ETag: [W/"7548ec7d845d6af32286d2251f2c0387"] | ||
48 | Transfer-Encoding: [chunked] | ||
49 | Vary: ['Accept-Encoding, Origin'] | ||
50 | X-Content-Type-Options: [nosniff] | ||
51 | X-Frame-Options: [SAMEORIGIN] | ||
52 | X-Request-Id: [f0e47488-db23-4ed8-bddd-8e5dfd4e2bb2] | ||
53 | X-Runtime: ['0.027973'] | ||
54 | X-XSS-Protection: [1; mode=block] | ||
55 | content-length: ['2'] | ||
56 | status: {code: 200, message: OK} | ||
57 | version: 1 | ||
diff --git a/tests/cassettes/test_status_post[None-public].yaml b/tests/cassettes/test_status_post[None-public].yaml new file mode 100644 index 0000000..fe4e4aa --- /dev/null +++ b/tests/cassettes/test_status_post[None-public].yaml | |||
@@ -0,0 +1,57 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: visibility=public&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['32'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078538720608883","created_at":"2017-11-27T21:35:22.971Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078538720608883","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078538720608883","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
16 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
17 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
18 | headers: | ||
19 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
20 | Content-Type: [application/json; charset=utf-8] | ||
21 | ETag: [W/"7c7848ecc424a862ae98bc25e4415f63"] | ||
22 | Transfer-Encoding: [chunked] | ||
23 | Vary: ['Accept-Encoding, Origin'] | ||
24 | X-Content-Type-Options: [nosniff] | ||
25 | X-Frame-Options: [SAMEORIGIN] | ||
26 | X-Request-Id: [9df93aa7-01a2-4bc7-b823-5d2dc2cc0168] | ||
27 | X-Runtime: ['0.097819'] | ||
28 | X-XSS-Protection: [1; mode=block] | ||
29 | content-length: ['1216'] | ||
30 | status: {code: 200, message: OK} | ||
31 | - request: | ||
32 | body: null | ||
33 | headers: | ||
34 | Accept: ['*/*'] | ||
35 | Accept-Encoding: ['gzip, deflate'] | ||
36 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
37 | Connection: [keep-alive] | ||
38 | Content-Length: ['0'] | ||
39 | User-Agent: [python-requests/2.18.4] | ||
40 | method: DELETE | ||
41 | uri: http://localhost:3000/api/v1/statuses/99078538720608883 | ||
42 | response: | ||
43 | body: {string: '{}'} | ||
44 | headers: | ||
45 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
46 | Content-Type: [application/json; charset=utf-8] | ||
47 | ETag: [W/"f7fc33915846d26da15c0f1b7a4a278c"] | ||
48 | Transfer-Encoding: [chunked] | ||
49 | Vary: ['Accept-Encoding, Origin'] | ||
50 | X-Content-Type-Options: [nosniff] | ||
51 | X-Frame-Options: [SAMEORIGIN] | ||
52 | X-Request-Id: [cf306f8f-2c95-4490-bf8f-9591d175ae66] | ||
53 | X-Runtime: ['0.040092'] | ||
54 | X-XSS-Protection: [1; mode=block] | ||
55 | content-length: ['2'] | ||
56 | status: {code: 200, message: OK} | ||
57 | version: 1 | ||
diff --git a/tests/cassettes/test_status_post[None-unlisted].yaml b/tests/cassettes/test_status_post[None-unlisted].yaml new file mode 100644 index 0000000..86248b7 --- /dev/null +++ b/tests/cassettes/test_status_post[None-unlisted].yaml | |||
@@ -0,0 +1,57 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: visibility=unlisted&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['34'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078538701453338","created_at":"2017-11-27T21:35:22.676Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"unlisted","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078538701453338","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078538701453338","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
16 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
17 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":40},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
18 | headers: | ||
19 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
20 | Content-Type: [application/json; charset=utf-8] | ||
21 | ETag: [W/"c07d033393994fc9a63343bbff483fd9"] | ||
22 | Transfer-Encoding: [chunked] | ||
23 | Vary: ['Accept-Encoding, Origin'] | ||
24 | X-Content-Type-Options: [nosniff] | ||
25 | X-Frame-Options: [SAMEORIGIN] | ||
26 | X-Request-Id: [3d9ccf73-bbba-479c-a0c4-90058b546d41] | ||
27 | X-Runtime: ['0.141733'] | ||
28 | X-XSS-Protection: [1; mode=block] | ||
29 | content-length: ['1218'] | ||
30 | status: {code: 200, message: OK} | ||
31 | - request: | ||
32 | body: null | ||
33 | headers: | ||
34 | Accept: ['*/*'] | ||
35 | Accept-Encoding: ['gzip, deflate'] | ||
36 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
37 | Connection: [keep-alive] | ||
38 | Content-Length: ['0'] | ||
39 | User-Agent: [python-requests/2.18.4] | ||
40 | method: DELETE | ||
41 | uri: http://localhost:3000/api/v1/statuses/99078538701453338 | ||
42 | response: | ||
43 | body: {string: '{}'} | ||
44 | headers: | ||
45 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
46 | Content-Type: [application/json; charset=utf-8] | ||
47 | ETag: [W/"7548ec7d845d6af32286d2251f2c0387"] | ||
48 | Transfer-Encoding: [chunked] | ||
49 | Vary: ['Accept-Encoding, Origin'] | ||
50 | X-Content-Type-Options: [nosniff] | ||
51 | X-Frame-Options: [SAMEORIGIN] | ||
52 | X-Request-Id: [f2d81b12-4922-4ab2-bc94-c96e21e0e466] | ||
53 | X-Runtime: ['0.069950'] | ||
54 | X-XSS-Protection: [1; mode=block] | ||
55 | content-length: ['2'] | ||
56 | status: {code: 200, message: OK} | ||
57 | version: 1 | ||
diff --git a/tests/cassettes/test_status_post[None].yaml b/tests/cassettes/test_status_post[None].yaml new file mode 100644 index 0000000..a743da7 --- /dev/null +++ b/tests/cassettes/test_status_post[None].yaml | |||
@@ -0,0 +1,57 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: visibility=&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['26'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078538668966165","created_at":"2017-11-27T21:35:22.176Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078538668966165","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078538668966165","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
16 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
17 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":38},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
18 | headers: | ||
19 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
20 | Content-Type: [application/json; charset=utf-8] | ||
21 | ETag: [W/"a7742df83d4fac388cca08ce46082421"] | ||
22 | Transfer-Encoding: [chunked] | ||
23 | Vary: ['Accept-Encoding, Origin'] | ||
24 | X-Content-Type-Options: [nosniff] | ||
25 | X-Frame-Options: [SAMEORIGIN] | ||
26 | X-Request-Id: [e64ce8e1-2376-45af-8a24-fa8dbd148c01] | ||
27 | X-Runtime: ['0.073810'] | ||
28 | X-XSS-Protection: [1; mode=block] | ||
29 | content-length: ['1216'] | ||
30 | status: {code: 200, message: OK} | ||
31 | - request: | ||
32 | body: null | ||
33 | headers: | ||
34 | Accept: ['*/*'] | ||
35 | Accept-Encoding: ['gzip, deflate'] | ||
36 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
37 | Connection: [keep-alive] | ||
38 | Content-Length: ['0'] | ||
39 | User-Agent: [python-requests/2.18.4] | ||
40 | method: DELETE | ||
41 | uri: http://localhost:3000/api/v1/statuses/99078538668966165 | ||
42 | response: | ||
43 | body: {string: '{}'} | ||
44 | headers: | ||
45 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
46 | Content-Type: [application/json; charset=utf-8] | ||
47 | ETag: [W/"7548ec7d845d6af32286d2251f2c0387"] | ||
48 | Transfer-Encoding: [chunked] | ||
49 | Vary: ['Accept-Encoding, Origin'] | ||
50 | X-Content-Type-Options: [nosniff] | ||
51 | X-Frame-Options: [SAMEORIGIN] | ||
52 | X-Request-Id: [eaf8b74d-f6d1-48fb-8e4b-4ff6b3d6c019] | ||
53 | X-Runtime: ['0.017783'] | ||
54 | X-XSS-Protection: [1; mode=block] | ||
55 | content-length: ['2'] | ||
56 | status: {code: 200, message: OK} | ||
57 | version: 1 | ||
diff --git a/tests/cassettes/test_status_reblog_unreblog.yaml b/tests/cassettes/test_status_reblog_unreblog.yaml new file mode 100644 index 0000000..703f351 --- /dev/null +++ b/tests/cassettes/test_status_reblog_unreblog.yaml | |||
@@ -0,0 +1,117 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: visibility=&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['26'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078602504465984","created_at":"2017-11-27T21:51:36.228Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078602504465984","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078602504465984","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
16 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
17 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
18 | headers: | ||
19 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
20 | Content-Type: [application/json; charset=utf-8] | ||
21 | ETag: [W/"bbc6e496d298265c537670c07d8bccdf"] | ||
22 | Transfer-Encoding: [chunked] | ||
23 | Vary: ['Accept-Encoding, Origin'] | ||
24 | X-Content-Type-Options: [nosniff] | ||
25 | X-Frame-Options: [SAMEORIGIN] | ||
26 | X-Request-Id: [21a5d437-9323-4226-8b11-b2875428afaf] | ||
27 | X-Runtime: ['0.059917'] | ||
28 | X-XSS-Protection: [1; mode=block] | ||
29 | content-length: ['1216'] | ||
30 | status: {code: 200, message: OK} | ||
31 | - request: | ||
32 | body: null | ||
33 | headers: | ||
34 | Accept: ['*/*'] | ||
35 | Accept-Encoding: ['gzip, deflate'] | ||
36 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
37 | Connection: [keep-alive] | ||
38 | Content-Length: ['0'] | ||
39 | User-Agent: [python-requests/2.18.4] | ||
40 | method: POST | ||
41 | uri: http://localhost:3000/api/v1/statuses/99078602504465984/reblog | ||
42 | response: | ||
43 | body: {string: '{"id":"99078602509548908","created_at":"2017-11-27T21:51:36.306Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":null,"uri":"http://localhost:3000/users/admin/statuses/99078602509548908/activity","content":"\u003cp\u003eRT | ||
44 | \u003cspan class=\"h-card\"\u003e\u003ca href=\"http://localhost:3000/@admin\" | ||
45 | class=\"u-url mention\"\u003e@\u003cspan\u003eadmin\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e | ||
46 | Toot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078602509548908","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":true,"muted":false,"reblog":{"id":"99078602504465984","created_at":"2017-11-27T21:51:36.228Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078602504465984","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078602504465984","reblogs_count":1,"favourites_count":0,"favourited":false,"reblogged":true,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
47 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
48 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":39},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]},"application":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
49 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":40},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
50 | headers: | ||
51 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
52 | Content-Type: [application/json; charset=utf-8] | ||
53 | ETag: [W/"fe1e853c3b03ebcec5abd1e1b35d2a80"] | ||
54 | Transfer-Encoding: [chunked] | ||
55 | Vary: ['Accept-Encoding, Origin'] | ||
56 | X-Content-Type-Options: [nosniff] | ||
57 | X-Frame-Options: [SAMEORIGIN] | ||
58 | X-Request-Id: [f0a0c6e8-8e44-455d-a25a-35fdafb12a85] | ||
59 | X-Runtime: ['0.091112'] | ||
60 | X-XSS-Protection: [1; mode=block] | ||
61 | content-length: ['2558'] | ||
62 | status: {code: 200, message: OK} | ||
63 | - request: | ||
64 | body: null | ||
65 | headers: | ||
66 | Accept: ['*/*'] | ||
67 | Accept-Encoding: ['gzip, deflate'] | ||
68 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
69 | Connection: [keep-alive] | ||
70 | Content-Length: ['0'] | ||
71 | User-Agent: [python-requests/2.18.4] | ||
72 | method: POST | ||
73 | uri: http://localhost:3000/api/v1/statuses/99078602504465984/unreblog | ||
74 | response: | ||
75 | body: {string: '{"id":"99078602504465984","created_at":"2017-11-27T21:51:36.228Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078602504465984","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078602504465984","reblogs_count":1,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
76 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
77 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":40},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
78 | headers: | ||
79 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
80 | Content-Type: [application/json; charset=utf-8] | ||
81 | ETag: [W/"a61d4671c0bb3fc5b5170c4f412adaf9"] | ||
82 | Transfer-Encoding: [chunked] | ||
83 | Vary: ['Accept-Encoding, Origin'] | ||
84 | X-Content-Type-Options: [nosniff] | ||
85 | X-Frame-Options: [SAMEORIGIN] | ||
86 | X-Request-Id: [0fbd79a3-ef33-462d-898d-12cf236217c2] | ||
87 | X-Runtime: ['0.057957'] | ||
88 | X-XSS-Protection: [1; mode=block] | ||
89 | content-length: ['1216'] | ||
90 | status: {code: 200, message: OK} | ||
91 | - request: | ||
92 | body: null | ||
93 | headers: | ||
94 | Accept: ['*/*'] | ||
95 | Accept-Encoding: ['gzip, deflate'] | ||
96 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
97 | Connection: [keep-alive] | ||
98 | Content-Length: ['0'] | ||
99 | User-Agent: [python-requests/2.18.4] | ||
100 | method: DELETE | ||
101 | uri: http://localhost:3000/api/v1/statuses/99078602504465984 | ||
102 | response: | ||
103 | body: {string: '{}'} | ||
104 | headers: | ||
105 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
106 | Content-Type: [application/json; charset=utf-8] | ||
107 | ETag: [W/"e7d76440082320bd78d556c907de0f9b"] | ||
108 | Transfer-Encoding: [chunked] | ||
109 | Vary: ['Accept-Encoding, Origin'] | ||
110 | X-Content-Type-Options: [nosniff] | ||
111 | X-Frame-Options: [SAMEORIGIN] | ||
112 | X-Request-Id: [e1e8b44b-1862-4f8a-ab62-815d4b0aeec2] | ||
113 | X-Runtime: ['0.023916'] | ||
114 | X-XSS-Protection: [1; mode=block] | ||
115 | content-length: ['2'] | ||
116 | status: {code: 200, message: OK} | ||
117 | version: 1 | ||
diff --git a/tests/cassettes/test_toot.yaml b/tests/cassettes/test_toot.yaml new file mode 100644 index 0000000..cbfdcd0 --- /dev/null +++ b/tests/cassettes/test_toot.yaml | |||
@@ -0,0 +1,57 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: visibility=&status=Toot%21 | ||
4 | headers: | ||
5 | Accept: ['*/*'] | ||
6 | Accept-Encoding: ['gzip, deflate'] | ||
7 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
8 | Connection: [keep-alive] | ||
9 | Content-Length: ['26'] | ||
10 | Content-Type: [application/x-www-form-urlencoded] | ||
11 | User-Agent: [python-requests/2.18.4] | ||
12 | method: POST | ||
13 | uri: http://localhost:3000/api/v1/statuses | ||
14 | response: | ||
15 | body: {string: '{"id":"99078501731927512","created_at":"2017-11-27T21:25:58.562Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99078501731927512","content":"\u003cp\u003eToot!\u003c/p\u003e","url":"http://localhost:3000/@admin/99078501731927512","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py | ||
16 | test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"codltest","locked":false,"created_at":"2017-07-01T17:09:15.621Z","note":"\u003cp\u003ehello | ||
17 | :)\u003c/p\u003e","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","avatar_static":"http://localhost:3000/system/accounts/avatars/000/000/001/original/99b4c443463de195.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":30},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'} | ||
18 | headers: | ||
19 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
20 | Content-Type: [application/json; charset=utf-8] | ||
21 | ETag: [W/"c4945db1d810e99768892d9fc9c9d8a4"] | ||
22 | Transfer-Encoding: [chunked] | ||
23 | Vary: ['Accept-Encoding, Origin'] | ||
24 | X-Content-Type-Options: [nosniff] | ||
25 | X-Frame-Options: [SAMEORIGIN] | ||
26 | X-Request-Id: [7553b112-6e37-473e-8504-a7a219e59845] | ||
27 | X-Runtime: ['0.056214'] | ||
28 | X-XSS-Protection: [1; mode=block] | ||
29 | content-length: ['1216'] | ||
30 | status: {code: 200, message: OK} | ||
31 | - request: | ||
32 | body: null | ||
33 | headers: | ||
34 | Accept: ['*/*'] | ||
35 | Accept-Encoding: ['gzip, deflate'] | ||
36 | Authorization: [Bearer __MASTODON_PY_TEST_TOKEN] | ||
37 | Connection: [keep-alive] | ||
38 | Content-Length: ['0'] | ||
39 | User-Agent: [python-requests/2.18.4] | ||
40 | method: DELETE | ||
41 | uri: http://localhost:3000/api/v1/statuses/99078501731927512 | ||
42 | response: | ||
43 | body: {string: '{}'} | ||
44 | headers: | ||
45 | Cache-Control: ['max-age=0, private, must-revalidate'] | ||
46 | Content-Type: [application/json; charset=utf-8] | ||
47 | ETag: [W/"d7b7c705458e698d74a8e1d89b319c36"] | ||
48 | Transfer-Encoding: [chunked] | ||
49 | Vary: ['Accept-Encoding, Origin'] | ||
50 | X-Content-Type-Options: [nosniff] | ||
51 | X-Frame-Options: [SAMEORIGIN] | ||
52 | X-Request-Id: [e8d5ae6f-6ceb-4e7d-a3f7-53c9c1384551] | ||
53 | X-Runtime: ['0.019255'] | ||
54 | X-XSS-Protection: [1; mode=block] | ||
55 | content-length: ['2'] | ||
56 | status: {code: 200, message: OK} | ||
57 | version: 1 | ||
diff --git a/tests/test_status.py b/tests/test_status.py index 971940a..a5b8b3a 100644 --- a/tests/test_status.py +++ b/tests/test_status.py | |||
@@ -1,5 +1,6 @@ | |||
1 | import pytest | 1 | import pytest |
2 | from mastodon.Mastodon import MastodonAPIError | 2 | from mastodon.Mastodon import MastodonAPIError |
3 | from time import sleep | ||
3 | 4 | ||
4 | @pytest.mark.vcr() | 5 | @pytest.mark.vcr() |
5 | def test_status(status, api): | 6 | def test_status(status, api): |
@@ -33,3 +34,58 @@ def test_status_favourited_by(status, api): | |||
33 | api.status_favourite(status['id']) | 34 | api.status_favourite(status['id']) |
34 | favourites = api.status_favourited_by(status['id']) | 35 | favourites = api.status_favourited_by(status['id']) |
35 | assert favourites | 36 | assert favourites |
37 | |||
38 | @pytest.mark.vcr() | ||
39 | def test_toot(api): | ||
40 | status = api.toot('Toot!') | ||
41 | try: | ||
42 | assert status | ||
43 | finally: | ||
44 | api.status_delete(status['id']) | ||
45 | |||
46 | @pytest.mark.vcr() | ||
47 | @pytest.mark.parametrize('visibility', ('', 'direct', 'private', 'unlisted', 'public', | ||
48 | pytest.param('foobar', marks=pytest.mark.xfail()))) | ||
49 | @pytest.mark.parametrize('spoiler_text', (None, 'Content warning')) | ||
50 | def test_status_post(api, visibility, spoiler_text): | ||
51 | status = api.status_post( | ||
52 | 'Toot!', | ||
53 | visibility=visibility, | ||
54 | spoiler_text=spoiler_text) | ||
55 | try: | ||
56 | assert status | ||
57 | if visibility: | ||
58 | assert status['visibility'] == visibility | ||
59 | if spoiler_text: | ||
60 | assert status['spoiler_text'] == spoiler_text | ||
61 | finally: | ||
62 | api.status_delete(status['id']) | ||
63 | |||
64 | @pytest.mark.vcr() | ||
65 | def test_status_reblog_unreblog(status, api): | ||
66 | reblog = api.status_reblog(status['id']) | ||
67 | assert reblog | ||
68 | |||
69 | status = reblog['reblog'] | ||
70 | assert status['reblogged'] | ||
71 | |||
72 | status = api.status_unreblog(status['id']) | ||
73 | assert not status['reblogged'] | ||
74 | |||
75 | |||
76 | @pytest.mark.vcr() | ||
77 | def test_status_fav_unfav(status, api): | ||
78 | status = api.status_favourite(status['id']) | ||
79 | assert status['favourited'] | ||
80 | |||
81 | status = api.status_unfavourite(status['id']) | ||
82 | assert not status['favourited'] | ||
83 | |||
84 | |||
85 | @pytest.mark.vcr() | ||
86 | def test_status_mute_unmute(status, api): | ||
87 | status = api.status_mute(status['id']) | ||
88 | assert status['muted'] | ||
89 | |||
90 | status = api.status_unmute(status['id']) | ||
91 | assert not status['muted'] | ||