diff options
author | halcy <halcy@ARARAGI-KUN> | 2022-11-13 16:02:34 +0200 |
---|---|---|
committer | halcy <halcy@ARARAGI-KUN> | 2022-11-13 16:02:34 +0200 |
commit | c66015a6b0655f865c45587095ca8744a9d61534 (patch) | |
tree | bf73abb2a2170b7b77f926a335593290e8e1eb57 | |
parent | b1e1ec7bdc9e84ecd31626f1a4fbf645e84d0bb2 (diff) | |
download | mastodon.py-c66015a6b0655f865c45587095ca8744a9d61534.tar.gz |
Add support and tests for "notifying" follow
-rw-r--r-- | TODO.md | 4 | ||||
-rw-r--r-- | docs/index.rst | 1 | ||||
-rw-r--r-- | mastodon/Mastodon.py | 7 | ||||
-rw-r--r-- | tests/cassettes/test_follow_with_notify_reblog.yaml | 665 | ||||
-rw-r--r-- | tests/test_account.py | 22 | ||||
-rw-r--r-- | tests/test_notifications.py | 1 |
6 files changed, 692 insertions, 8 deletions
@@ -20,8 +20,8 @@ Refer to mastodon changelog and API docs for details when implementing, add or m | |||
20 | 20 | ||
21 | 3.3.0 | 21 | 3.3.0 |
22 | ----- | 22 | ----- |
23 | * [ ] Add option to be notified when a followed user posts | 23 | * [x] Add option to be notified when a followed user posts |
24 | * [ ] Add duration option to the mute function | 24 | * [x] Add duration option to the mute function |
25 | * [ ] Add ability to block access or limit sign-ups from chosen IPs | 25 | * [ ] Add ability to block access or limit sign-ups from chosen IPs |
26 | * [ ] Add support for managing multiple stream subscriptions in a single connection | 26 | * [ ] Add support for managing multiple stream subscriptions in a single connection |
27 | * [x] Add support for limiting results by both min_id and max_id at the same time in REST API | 27 | * [x] Add support for limiting results by both min_id and max_id at the same time in REST API |
diff --git a/docs/index.rst b/docs/index.rst index 1935428..9083fc9 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -496,6 +496,7 @@ Relationship dicts | |||
496 | 'endorsed': # Boolean denoting wheter the specified user is being endorsed / featured by the | 496 | 'endorsed': # Boolean denoting wheter the specified user is being endorsed / featured by the |
497 | # logged-in user | 497 | # logged-in user |
498 | 'note': # A free text note the logged in user has created for this account (not publicly visible) | 498 | 'note': # A free text note the logged in user has created for this account (not publicly visible) |
499 | 'notifying' # Boolean denoting whether the logged-in user has requested to get notified every time the followed user posts | ||
499 | } | 500 | } |
500 | 501 | ||
501 | Filter dicts | 502 | Filter dicts |
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 2d56ac9..7db5fba 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -215,7 +215,7 @@ class Mastodon: | |||
215 | __DICT_VERSION_INSTANCE = bigger_version("3.1.4", __DICT_VERSION_ACCOUNT) | 215 | __DICT_VERSION_INSTANCE = bigger_version("3.1.4", __DICT_VERSION_ACCOUNT) |
216 | __DICT_VERSION_HASHTAG = "2.3.4" | 216 | __DICT_VERSION_HASHTAG = "2.3.4" |
217 | __DICT_VERSION_EMOJI = "3.0.0" | 217 | __DICT_VERSION_EMOJI = "3.0.0" |
218 | __DICT_VERSION_RELATIONSHIP = "3.2.0" | 218 | __DICT_VERSION_RELATIONSHIP = "3.3.0" |
219 | __DICT_VERSION_NOTIFICATION = bigger_version(bigger_version("1.0.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS) | 219 | __DICT_VERSION_NOTIFICATION = bigger_version(bigger_version("1.0.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS) |
220 | __DICT_VERSION_CONTEXT = bigger_version("1.0.0", __DICT_VERSION_STATUS) | 220 | __DICT_VERSION_CONTEXT = bigger_version("1.0.0", __DICT_VERSION_STATUS) |
221 | __DICT_VERSION_LIST = "2.1.0" | 221 | __DICT_VERSION_LIST = "2.1.0" |
@@ -2098,12 +2098,13 @@ class Mastodon: | |||
2098 | ### | 2098 | ### |
2099 | # Writing data: Accounts | 2099 | # Writing data: Accounts |
2100 | ### | 2100 | ### |
2101 | @api_version("1.0.0", "2.4.3", __DICT_VERSION_RELATIONSHIP) | 2101 | @api_version("1.0.0", "3.3.0", __DICT_VERSION_RELATIONSHIP) |
2102 | def account_follow(self, id, reblogs=True): | 2102 | def account_follow(self, id, reblogs=True, notify=False): |
2103 | """ | 2103 | """ |
2104 | Follow a user. | 2104 | Follow a user. |
2105 | 2105 | ||
2106 | Set `reblogs` to False to hide boosts by the followed user. | 2106 | Set `reblogs` to False to hide boosts by the followed user. |
2107 | Set `notify` to True to get a notification every time the followed user posts. | ||
2107 | 2108 | ||
2108 | Returns a `relationship dict`_ containing the updated relationship to the user. | 2109 | Returns a `relationship dict`_ containing the updated relationship to the user. |
2109 | """ | 2110 | """ |
diff --git a/tests/cassettes/test_follow_with_notify_reblog.yaml b/tests/cassettes/test_follow_with_notify_reblog.yaml new file mode 100644 index 0000000..0d3fc48 --- /dev/null +++ b/tests/cassettes/test_follow_with_notify_reblog.yaml | |||
@@ -0,0 +1,665 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: null | ||
4 | headers: | ||
5 | Accept: | ||
6 | - '*/*' | ||
7 | Accept-Encoding: | ||
8 | - gzip, deflate | ||
9 | Authorization: | ||
10 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
11 | Connection: | ||
12 | - keep-alive | ||
13 | User-Agent: | ||
14 | - tests/v311 | ||
15 | method: GET | ||
16 | uri: http://localhost:3000/api/v1/accounts/verify_credentials | ||
17 | response: | ||
18 | body: | ||
19 | string: '{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":5,"last_status_at":"2022-11-13","noindex":false,"source":{"privacy":"public","sensitive":false,"language":null,"note":"","fields":[],"follow_requests_count":0},"emojis":[],"fields":[],"role":{"id":"3","name":"Owner","permissions":"1048575","color":"","highlighted":true}}' | ||
20 | headers: | ||
21 | Cache-Control: | ||
22 | - no-store | ||
23 | Content-Security-Policy: | ||
24 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
25 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
26 | style-src ''self'' http://localhost:3000 ''nonce-uS7exBS4RMpfA9zKIho8og==''; | ||
27 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
28 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
29 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
30 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
31 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
32 | worker-src ''self'' blob: http://localhost:3000' | ||
33 | Content-Type: | ||
34 | - application/json; charset=utf-8 | ||
35 | ETag: | ||
36 | - W/"c8b7fdcc68fcea8c85022735def25829" | ||
37 | Referrer-Policy: | ||
38 | - strict-origin-when-cross-origin | ||
39 | Transfer-Encoding: | ||
40 | - chunked | ||
41 | Vary: | ||
42 | - Accept, Origin | ||
43 | X-Content-Type-Options: | ||
44 | - nosniff | ||
45 | X-Download-Options: | ||
46 | - noopen | ||
47 | X-Frame-Options: | ||
48 | - SAMEORIGIN | ||
49 | X-Permitted-Cross-Domain-Policies: | ||
50 | - none | ||
51 | X-Request-Id: | ||
52 | - ab22558b-169c-4a41-ab51-c1eaae565a1b | ||
53 | X-Runtime: | ||
54 | - '0.012066' | ||
55 | X-XSS-Protection: | ||
56 | - 1; mode=block | ||
57 | status: | ||
58 | code: 200 | ||
59 | message: OK | ||
60 | - request: | ||
61 | body: id=109336623096259500&reblogs=0¬ify=1 | ||
62 | headers: | ||
63 | Accept: | ||
64 | - '*/*' | ||
65 | Accept-Encoding: | ||
66 | - gzip, deflate | ||
67 | Authorization: | ||
68 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN | ||
69 | Connection: | ||
70 | - keep-alive | ||
71 | Content-Length: | ||
72 | - '40' | ||
73 | Content-Type: | ||
74 | - application/x-www-form-urlencoded | ||
75 | User-Agent: | ||
76 | - tests/v311 | ||
77 | method: POST | ||
78 | uri: http://localhost:3000/api/v1/accounts/109336623096259500/follow | ||
79 | response: | ||
80 | body: | ||
81 | string: '{"id":"109336623096259500","following":true,"showing_reblogs":false,"notifying":true,"languages":null,"followed_by":false,"blocking":false,"blocked_by":false,"muting":false,"muting_notifications":false,"requested":false,"domain_blocking":false,"endorsed":false,"note":"top | ||
82 | ebayer gerne wieder"}' | ||
83 | headers: | ||
84 | Cache-Control: | ||
85 | - no-store | ||
86 | Content-Security-Policy: | ||
87 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
88 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
89 | style-src ''self'' http://localhost:3000 ''nonce-YRtCuk4cER3IJ4KAPZQMjQ==''; | ||
90 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
91 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
92 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
93 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
94 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
95 | worker-src ''self'' blob: http://localhost:3000' | ||
96 | Content-Type: | ||
97 | - application/json; charset=utf-8 | ||
98 | ETag: | ||
99 | - W/"99777c022aac4553e95b89fa7d1cdf52" | ||
100 | Referrer-Policy: | ||
101 | - strict-origin-when-cross-origin | ||
102 | Transfer-Encoding: | ||
103 | - chunked | ||
104 | Vary: | ||
105 | - Accept, Origin | ||
106 | X-Content-Type-Options: | ||
107 | - nosniff | ||
108 | X-Download-Options: | ||
109 | - noopen | ||
110 | X-Frame-Options: | ||
111 | - SAMEORIGIN | ||
112 | X-Permitted-Cross-Domain-Policies: | ||
113 | - none | ||
114 | X-RateLimit-Limit: | ||
115 | - '400' | ||
116 | X-RateLimit-Remaining: | ||
117 | - '391' | ||
118 | X-RateLimit-Reset: | ||
119 | - '2022-11-14T00:00:00.902637Z' | ||
120 | X-Request-Id: | ||
121 | - f6c76e22-8885-4f41-a189-1896ded56c01 | ||
122 | X-Runtime: | ||
123 | - '0.021815' | ||
124 | X-XSS-Protection: | ||
125 | - 1; mode=block | ||
126 | status: | ||
127 | code: 200 | ||
128 | message: OK | ||
129 | - request: | ||
130 | body: status=rootin+tooting+and+shootin | ||
131 | headers: | ||
132 | Accept: | ||
133 | - '*/*' | ||
134 | Accept-Encoding: | ||
135 | - gzip, deflate | ||
136 | Authorization: | ||
137 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_3 | ||
138 | Connection: | ||
139 | - keep-alive | ||
140 | Content-Length: | ||
141 | - '33' | ||
142 | Content-Type: | ||
143 | - application/x-www-form-urlencoded | ||
144 | User-Agent: | ||
145 | - tests/v311 | ||
146 | method: POST | ||
147 | uri: http://localhost:3000/api/v1/statuses | ||
148 | response: | ||
149 | body: | ||
150 | string: '{"id":"109336852163356113","created_at":"2022-11-13T13:59:23.919Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test_2/statuses/109336852163356113","url":"http://localhost:3000/@mastodonpy_test_2/109336852163356113","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003erootin | ||
151 | tooting and shootin\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
152 | test suite","website":null},"account":{"id":"109336623415600158","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test_2","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":2,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' | ||
153 | headers: | ||
154 | Cache-Control: | ||
155 | - no-store | ||
156 | Content-Security-Policy: | ||
157 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
158 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
159 | style-src ''self'' http://localhost:3000 ''nonce-rJtmP520teUmbAS31nwZfw==''; | ||
160 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
161 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
162 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
163 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
164 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
165 | worker-src ''self'' blob: http://localhost:3000' | ||
166 | Content-Type: | ||
167 | - application/json; charset=utf-8 | ||
168 | ETag: | ||
169 | - W/"3df7b27876a5ccabcf05f1c9995ad0ab" | ||
170 | Referrer-Policy: | ||
171 | - strict-origin-when-cross-origin | ||
172 | Transfer-Encoding: | ||
173 | - chunked | ||
174 | Vary: | ||
175 | - Accept, Origin | ||
176 | X-Content-Type-Options: | ||
177 | - nosniff | ||
178 | X-Download-Options: | ||
179 | - noopen | ||
180 | X-Frame-Options: | ||
181 | - SAMEORIGIN | ||
182 | X-Permitted-Cross-Domain-Policies: | ||
183 | - none | ||
184 | X-RateLimit-Limit: | ||
185 | - '300' | ||
186 | X-RateLimit-Remaining: | ||
187 | - '296' | ||
188 | X-RateLimit-Reset: | ||
189 | - '2022-11-13T15:00:00.940930Z' | ||
190 | X-Request-Id: | ||
191 | - fdfa666a-885c-4d77-82d9-81cbbfeb5813 | ||
192 | X-Runtime: | ||
193 | - '0.033721' | ||
194 | X-XSS-Protection: | ||
195 | - 1; mode=block | ||
196 | status: | ||
197 | code: 200 | ||
198 | message: OK | ||
199 | - request: | ||
200 | body: status=horses+are+not+real | ||
201 | headers: | ||
202 | Accept: | ||
203 | - '*/*' | ||
204 | Accept-Encoding: | ||
205 | - gzip, deflate | ||
206 | Authorization: | ||
207 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
208 | Connection: | ||
209 | - keep-alive | ||
210 | Content-Length: | ||
211 | - '26' | ||
212 | Content-Type: | ||
213 | - application/x-www-form-urlencoded | ||
214 | User-Agent: | ||
215 | - tests/v311 | ||
216 | method: POST | ||
217 | uri: http://localhost:3000/api/v1/statuses | ||
218 | response: | ||
219 | body: | ||
220 | string: '{"id":"109336852231439258","created_at":"2022-11-13T13:59:24.958Z","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/109336852231439258","url":"http://localhost:3000/@admin/109336852231439258","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003ehorses | ||
221 | are not real\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
222 | test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":6,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' | ||
223 | headers: | ||
224 | Cache-Control: | ||
225 | - no-store | ||
226 | Content-Security-Policy: | ||
227 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
228 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
229 | style-src ''self'' http://localhost:3000 ''nonce-aP5ZepJpFHR7Qp5sH/saGA==''; | ||
230 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
231 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
232 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
233 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
234 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
235 | worker-src ''self'' blob: http://localhost:3000' | ||
236 | Content-Type: | ||
237 | - application/json; charset=utf-8 | ||
238 | ETag: | ||
239 | - W/"77a7a384e480a6e8fe96f15dd6aba687" | ||
240 | Referrer-Policy: | ||
241 | - strict-origin-when-cross-origin | ||
242 | Transfer-Encoding: | ||
243 | - chunked | ||
244 | Vary: | ||
245 | - Accept, Origin | ||
246 | X-Content-Type-Options: | ||
247 | - nosniff | ||
248 | X-Download-Options: | ||
249 | - noopen | ||
250 | X-Frame-Options: | ||
251 | - SAMEORIGIN | ||
252 | X-Permitted-Cross-Domain-Policies: | ||
253 | - none | ||
254 | X-RateLimit-Limit: | ||
255 | - '300' | ||
256 | X-RateLimit-Remaining: | ||
257 | - '276' | ||
258 | X-RateLimit-Reset: | ||
259 | - '2022-11-13T15:00:00.986554Z' | ||
260 | X-Request-Id: | ||
261 | - 17e5f05b-cd90-4b86-84c0-809056fab257 | ||
262 | X-Runtime: | ||
263 | - '0.039939' | ||
264 | X-XSS-Protection: | ||
265 | - 1; mode=block | ||
266 | status: | ||
267 | code: 200 | ||
268 | message: OK | ||
269 | - request: | ||
270 | body: null | ||
271 | headers: | ||
272 | Accept: | ||
273 | - '*/*' | ||
274 | Accept-Encoding: | ||
275 | - gzip, deflate | ||
276 | Authorization: | ||
277 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
278 | Connection: | ||
279 | - keep-alive | ||
280 | Content-Length: | ||
281 | - '0' | ||
282 | User-Agent: | ||
283 | - tests/v311 | ||
284 | method: POST | ||
285 | uri: http://localhost:3000/api/v1/statuses/109336852163356113/reblog | ||
286 | response: | ||
287 | body: | ||
288 | string: '{"id":"109336852234411327","created_at":"2022-11-13T13:59:25.003Z","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/109336852234411327/activity","url":"http://localhost:3000/users/admin/statuses/109336852234411327/activity","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":true,"muted":false,"bookmarked":false,"content":"","filtered":[],"reblog":{"id":"109336852163356113","created_at":"2022-11-13T13:59:23.919Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test_2/statuses/109336852163356113","url":"http://localhost:3000/@mastodonpy_test_2/109336852163356113","replies_count":0,"reblogs_count":1,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":true,"muted":false,"bookmarked":false,"content":"\u003cp\u003erootin | ||
289 | tooting and shootin\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
290 | test suite","website":null},"account":{"id":"109336623415600158","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test_2","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":2,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},"application":null,"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":7,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' | ||
291 | headers: | ||
292 | Cache-Control: | ||
293 | - no-store | ||
294 | Content-Security-Policy: | ||
295 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
296 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
297 | style-src ''self'' http://localhost:3000 ''nonce-7iO8oD4GFiOLby+H0bj0yw==''; | ||
298 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
299 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
300 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
301 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
302 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
303 | worker-src ''self'' blob: http://localhost:3000' | ||
304 | Content-Type: | ||
305 | - application/json; charset=utf-8 | ||
306 | ETag: | ||
307 | - W/"7cffc8e25d18ffb7b9691c7217ac8c68" | ||
308 | Referrer-Policy: | ||
309 | - strict-origin-when-cross-origin | ||
310 | Transfer-Encoding: | ||
311 | - chunked | ||
312 | Vary: | ||
313 | - Accept, Origin | ||
314 | X-Content-Type-Options: | ||
315 | - nosniff | ||
316 | X-Download-Options: | ||
317 | - noopen | ||
318 | X-Frame-Options: | ||
319 | - SAMEORIGIN | ||
320 | X-Permitted-Cross-Domain-Policies: | ||
321 | - none | ||
322 | X-RateLimit-Limit: | ||
323 | - '300' | ||
324 | X-RateLimit-Remaining: | ||
325 | - '276' | ||
326 | X-RateLimit-Reset: | ||
327 | - '2022-11-13T15:00:00.036550Z' | ||
328 | X-Request-Id: | ||
329 | - e42fafef-bd21-4bf5-b53e-6d6b2e53b432 | ||
330 | X-Runtime: | ||
331 | - '0.046112' | ||
332 | X-XSS-Protection: | ||
333 | - 1; mode=block | ||
334 | status: | ||
335 | code: 200 | ||
336 | message: OK | ||
337 | - request: | ||
338 | body: null | ||
339 | headers: | ||
340 | Accept: | ||
341 | - '*/*' | ||
342 | Accept-Encoding: | ||
343 | - gzip, deflate | ||
344 | Authorization: | ||
345 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN | ||
346 | Connection: | ||
347 | - keep-alive | ||
348 | User-Agent: | ||
349 | - tests/v311 | ||
350 | method: GET | ||
351 | uri: http://localhost:3000/api/v1/notifications | ||
352 | response: | ||
353 | body: | ||
354 | string: '[{"id":"29","type":"status","created_at":"2022-11-13T13:59:25.305Z","account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":7,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"status":{"id":"109336852231439258","created_at":"2022-11-13T13:59:24.958Z","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/109336852231439258","url":"http://localhost:3000/@admin/109336852231439258","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003ehorses | ||
355 | are not real\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
356 | test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":7,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}},{"id":"26","type":"status","created_at":"2022-11-13T13:56:44.958Z","account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":7,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"status":{"id":"109336841715165741","created_at":"2022-11-13T13:56:44.492Z","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/109336841715165741","url":"http://localhost:3000/@admin/109336841715165741","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003ehorses | ||
357 | are not real\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
358 | test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":7,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}}]' | ||
359 | headers: | ||
360 | Cache-Control: | ||
361 | - no-store | ||
362 | Content-Security-Policy: | ||
363 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
364 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
365 | style-src ''self'' http://localhost:3000 ''nonce-PR0gTQK+R6rN1/fgM1tpwQ==''; | ||
366 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
367 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
368 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
369 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
370 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
371 | worker-src ''self'' blob: http://localhost:3000' | ||
372 | Content-Type: | ||
373 | - application/json; charset=utf-8 | ||
374 | ETag: | ||
375 | - W/"45c835cacac6df44f95efa217d690ad8" | ||
376 | Link: | ||
377 | - <http://localhost:3000/api/v1/notifications?max_id=26>; rel="next", <http://localhost:3000/api/v1/notifications?min_id=29>; | ||
378 | rel="prev" | ||
379 | Referrer-Policy: | ||
380 | - strict-origin-when-cross-origin | ||
381 | Transfer-Encoding: | ||
382 | - chunked | ||
383 | Vary: | ||
384 | - Accept, Origin | ||
385 | X-Content-Type-Options: | ||
386 | - nosniff | ||
387 | X-Download-Options: | ||
388 | - noopen | ||
389 | X-Frame-Options: | ||
390 | - SAMEORIGIN | ||
391 | X-Permitted-Cross-Domain-Policies: | ||
392 | - none | ||
393 | X-Request-Id: | ||
394 | - ab9997d3-c930-4335-a839-718930776e17 | ||
395 | X-Runtime: | ||
396 | - '0.027844' | ||
397 | X-XSS-Protection: | ||
398 | - 1; mode=block | ||
399 | status: | ||
400 | code: 200 | ||
401 | message: OK | ||
402 | - request: | ||
403 | body: null | ||
404 | headers: | ||
405 | Accept: | ||
406 | - '*/*' | ||
407 | Accept-Encoding: | ||
408 | - gzip, deflate | ||
409 | Authorization: | ||
410 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN | ||
411 | Connection: | ||
412 | - keep-alive | ||
413 | User-Agent: | ||
414 | - tests/v311 | ||
415 | method: GET | ||
416 | uri: http://localhost:3000/api/v1/timelines/home?local=1 | ||
417 | response: | ||
418 | body: | ||
419 | string: '[{"id":"109336852231439258","created_at":"2022-11-13T13:59:24.958Z","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/109336852231439258","url":"http://localhost:3000/@admin/109336852231439258","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003ehorses | ||
420 | are not real\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
421 | test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":7,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"109336841715165741","created_at":"2022-11-13T13:56:44.492Z","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/109336841715165741","url":"http://localhost:3000/@admin/109336841715165741","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003ehorses | ||
422 | are not real\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
423 | test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":7,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"109336682422462377","created_at":"2022-11-13T13:16:13.878Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/109336682422462377","url":"http://localhost:3000/@mastodonpy_test/109336682422462377","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eit\u0026#39;s | ||
424 | cool guy\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
425 | test suite","website":null},"account":{"id":"109336623311102204","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"John | ||
426 | Lennon","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"\u003cp\u003eI | ||
427 | walk funny\u003c/p\u003e","url":"http://localhost:3000/@mastodonpy_test","avatar":"http://localhost:3000/system/accounts/avatars/109/336/623/311/102/204/original/8f758332953652da.jpg","avatar_static":"http://localhost:3000/system/accounts/avatars/109/336/623/311/102/204/original/8f758332953652da.jpg","header":"http://localhost:3000/system/accounts/headers/109/336/623/311/102/204/original/c7470bf076df1e55.jpg","header_static":"http://localhost:3000/system/accounts/headers/109/336/623/311/102/204/original/c7470bf076df1e55.jpg","followers_count":0,"following_count":1,"statuses_count":3,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[{"name":"bread","value":"toasty.","verified_at":null},{"name":"lasagna","value":"no!!!","verified_at":null}]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"109336681112255813","created_at":"2022-11-13T13:15:53.886Z","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/109336681112255813","url":"http://localhost:3000/@admin/109336681112255813","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003eon | ||
428 | the internet, nobody knows you\u0026#39;re a plane\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
429 | test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":7,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"109336681109577944","created_at":"2022-11-13T13:15:53.845Z","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/109336681109577944","url":"http://localhost:3000/@admin/109336681109577944","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003e\u003cspan | ||
430 | class=\"h-card\"\u003e\u003ca href=\"http://localhost:3000/@mastodonpy_test\" | ||
431 | class=\"u-url mention\"\u003e@\u003cspan\u003emastodonpy_test\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e | ||
432 | beep beep I\u0026#39;m a jeep\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
433 | test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":7,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109336623311102204","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null},{"id":"109336679609194893","created_at":"2022-11-13T13:15:30.952Z","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/109336679609194893","url":"http://localhost:3000/@admin/109336679609194893","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003enice\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
434 | test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.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":7,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":{"id":"2","expires_at":"2022-11-13T13:20:30.950Z","expired":true,"multiple":false,"votes_count":1,"voters_count":1,"voted":true,"own_votes":[1],"options":[{"title":"four | ||
435 | twenty","votes_count":0},{"title":"sixty-nine","votes_count":1}],"emojis":[]}}]' | ||
436 | headers: | ||
437 | Cache-Control: | ||
438 | - no-store | ||
439 | Content-Security-Policy: | ||
440 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
441 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
442 | style-src ''self'' http://localhost:3000 ''nonce-n91C5SphlprktCg4bDV0sw==''; | ||
443 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
444 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
445 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
446 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
447 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
448 | worker-src ''self'' blob: http://localhost:3000' | ||
449 | Content-Type: | ||
450 | - application/json; charset=utf-8 | ||
451 | ETag: | ||
452 | - W/"a18ef2c9f24ad454649334c88e6cceb9" | ||
453 | Link: | ||
454 | - <http://localhost:3000/api/v1/timelines/home?local=1&max_id=109336679609194893>; | ||
455 | rel="next", <http://localhost:3000/api/v1/timelines/home?local=1&min_id=109336852231439258>; | ||
456 | rel="prev" | ||
457 | Referrer-Policy: | ||
458 | - strict-origin-when-cross-origin | ||
459 | Transfer-Encoding: | ||
460 | - chunked | ||
461 | Vary: | ||
462 | - Accept, Origin | ||
463 | X-Content-Type-Options: | ||
464 | - nosniff | ||
465 | X-Download-Options: | ||
466 | - noopen | ||
467 | X-Frame-Options: | ||
468 | - SAMEORIGIN | ||
469 | X-Permitted-Cross-Domain-Policies: | ||
470 | - none | ||
471 | X-Request-Id: | ||
472 | - de3b2050-3b00-405c-8cb6-bd9dd4e32e2b | ||
473 | X-Runtime: | ||
474 | - '0.043971' | ||
475 | X-XSS-Protection: | ||
476 | - 1; mode=block | ||
477 | status: | ||
478 | code: 200 | ||
479 | message: OK | ||
480 | - request: | ||
481 | body: null | ||
482 | headers: | ||
483 | Accept: | ||
484 | - '*/*' | ||
485 | Accept-Encoding: | ||
486 | - gzip, deflate | ||
487 | Authorization: | ||
488 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN | ||
489 | Connection: | ||
490 | - keep-alive | ||
491 | Content-Length: | ||
492 | - '0' | ||
493 | User-Agent: | ||
494 | - tests/v311 | ||
495 | method: POST | ||
496 | uri: http://localhost:3000/api/v1/accounts/109336623096259500/unfollow | ||
497 | response: | ||
498 | body: | ||
499 | string: '{"id":"109336623096259500","following":false,"showing_reblogs":false,"notifying":false,"languages":null,"followed_by":false,"blocking":false,"blocked_by":false,"muting":false,"muting_notifications":false,"requested":false,"domain_blocking":false,"endorsed":false,"note":"top | ||
500 | ebayer gerne wieder"}' | ||
501 | headers: | ||
502 | Cache-Control: | ||
503 | - no-store | ||
504 | Content-Security-Policy: | ||
505 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
506 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
507 | style-src ''self'' http://localhost:3000 ''nonce-7W6NkyJEvQmKfbFEyMxwIA==''; | ||
508 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
509 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
510 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
511 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
512 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
513 | worker-src ''self'' blob: http://localhost:3000' | ||
514 | Content-Type: | ||
515 | - application/json; charset=utf-8 | ||
516 | ETag: | ||
517 | - W/"fc5fa4da9317772baa3b6968b8c31a68" | ||
518 | Referrer-Policy: | ||
519 | - strict-origin-when-cross-origin | ||
520 | Transfer-Encoding: | ||
521 | - chunked | ||
522 | Vary: | ||
523 | - Accept, Origin | ||
524 | X-Content-Type-Options: | ||
525 | - nosniff | ||
526 | X-Download-Options: | ||
527 | - noopen | ||
528 | X-Frame-Options: | ||
529 | - SAMEORIGIN | ||
530 | X-Permitted-Cross-Domain-Policies: | ||
531 | - none | ||
532 | X-Request-Id: | ||
533 | - f07c1479-112a-44f3-b83c-930d38ac996a | ||
534 | X-Runtime: | ||
535 | - '0.025638' | ||
536 | X-XSS-Protection: | ||
537 | - 1; mode=block | ||
538 | status: | ||
539 | code: 200 | ||
540 | message: OK | ||
541 | - request: | ||
542 | body: null | ||
543 | headers: | ||
544 | Accept: | ||
545 | - '*/*' | ||
546 | Accept-Encoding: | ||
547 | - gzip, deflate | ||
548 | Authorization: | ||
549 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_3 | ||
550 | Connection: | ||
551 | - keep-alive | ||
552 | Content-Length: | ||
553 | - '0' | ||
554 | User-Agent: | ||
555 | - tests/v311 | ||
556 | method: DELETE | ||
557 | uri: http://localhost:3000/api/v1/statuses/109336852163356113 | ||
558 | response: | ||
559 | body: | ||
560 | string: '{"id":"109336852163356113","created_at":"2022-11-13T13:59:23.919Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test_2/statuses/109336852163356113","url":"http://localhost:3000/@mastodonpy_test_2/109336852163356113","replies_count":0,"reblogs_count":1,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"rootin | ||
561 | tooting and shootin","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
562 | test suite","website":null},"account":{"id":"109336623415600158","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test_2","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' | ||
563 | headers: | ||
564 | Cache-Control: | ||
565 | - no-store | ||
566 | Content-Security-Policy: | ||
567 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
568 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
569 | style-src ''self'' http://localhost:3000 ''nonce-rgsUEdBX+2TXJ9j1b5NHYg==''; | ||
570 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
571 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
572 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
573 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
574 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
575 | worker-src ''self'' blob: http://localhost:3000' | ||
576 | Content-Type: | ||
577 | - application/json; charset=utf-8 | ||
578 | ETag: | ||
579 | - W/"bd5e476d8c6115f0b6ce3dff05cd0b60" | ||
580 | Referrer-Policy: | ||
581 | - strict-origin-when-cross-origin | ||
582 | Transfer-Encoding: | ||
583 | - chunked | ||
584 | Vary: | ||
585 | - Accept, Origin | ||
586 | X-Content-Type-Options: | ||
587 | - nosniff | ||
588 | X-Download-Options: | ||
589 | - noopen | ||
590 | X-Frame-Options: | ||
591 | - SAMEORIGIN | ||
592 | X-Permitted-Cross-Domain-Policies: | ||
593 | - none | ||
594 | X-Request-Id: | ||
595 | - 703899a3-bbae-429f-bd33-be2d0871c956 | ||
596 | X-Runtime: | ||
597 | - '0.033619' | ||
598 | X-XSS-Protection: | ||
599 | - 1; mode=block | ||
600 | status: | ||
601 | code: 200 | ||
602 | message: OK | ||
603 | - request: | ||
604 | body: null | ||
605 | headers: | ||
606 | Accept: | ||
607 | - '*/*' | ||
608 | Accept-Encoding: | ||
609 | - gzip, deflate | ||
610 | Authorization: | ||
611 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
612 | Connection: | ||
613 | - keep-alive | ||
614 | Content-Length: | ||
615 | - '0' | ||
616 | User-Agent: | ||
617 | - tests/v311 | ||
618 | method: DELETE | ||
619 | uri: http://localhost:3000/api/v1/statuses/109336852231439258 | ||
620 | response: | ||
621 | body: | ||
622 | string: '{"id":"109336852231439258","created_at":"2022-11-13T13:59:24.958Z","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/109336852231439258","url":"http://localhost:3000/@admin/109336852231439258","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"horses | ||
623 | are not real","filtered":[],"reblog":null,"application":{"name":"Mastodon.py | ||
624 | test suite","website":null},"account":{"id":"109336623096259500","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":6,"last_status_at":"2022-11-13","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' | ||
625 | headers: | ||
626 | Cache-Control: | ||
627 | - no-store | ||
628 | Content-Security-Policy: | ||
629 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
630 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
631 | style-src ''self'' http://localhost:3000 ''nonce-4awjPWzvNj9LOfWzGDa3ZQ==''; | ||
632 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
633 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
634 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
635 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
636 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
637 | worker-src ''self'' blob: http://localhost:3000' | ||
638 | Content-Type: | ||
639 | - application/json; charset=utf-8 | ||
640 | ETag: | ||
641 | - W/"6e6949a2db62d405d6a519d84d2e8ae3" | ||
642 | Referrer-Policy: | ||
643 | - strict-origin-when-cross-origin | ||
644 | Transfer-Encoding: | ||
645 | - chunked | ||
646 | Vary: | ||
647 | - Accept, Origin | ||
648 | X-Content-Type-Options: | ||
649 | - nosniff | ||
650 | X-Download-Options: | ||
651 | - noopen | ||
652 | X-Frame-Options: | ||
653 | - SAMEORIGIN | ||
654 | X-Permitted-Cross-Domain-Policies: | ||
655 | - none | ||
656 | X-Request-Id: | ||
657 | - 56b22297-c29c-470c-a85f-9d386d75889f | ||
658 | X-Runtime: | ||
659 | - '0.024267' | ||
660 | X-XSS-Protection: | ||
661 | - 1; mode=block | ||
662 | status: | ||
663 | code: 200 | ||
664 | message: OK | ||
665 | version: 1 | ||
diff --git a/tests/test_account.py b/tests/test_account.py index dad17e8..700433f 100644 --- a/tests/test_account.py +++ b/tests/test_account.py | |||
@@ -69,7 +69,6 @@ def test_account_follow_unfollow(api, api2): | |||
69 | assert relationship | 69 | assert relationship |
70 | assert not relationship['following'] | 70 | assert not relationship['following'] |
71 | 71 | ||
72 | |||
73 | @pytest.mark.vcr() | 72 | @pytest.mark.vcr() |
74 | def test_account_block_unblock(api, api2): | 73 | def test_account_block_unblock(api, api2): |
75 | api2_id = api2.account_verify_credentials().id | 74 | api2_id = api2.account_verify_credentials().id |
@@ -82,7 +81,6 @@ def test_account_block_unblock(api, api2): | |||
82 | assert relationship | 81 | assert relationship |
83 | assert not relationship['blocking'] | 82 | assert not relationship['blocking'] |
84 | 83 | ||
85 | |||
86 | @pytest.mark.vcr() | 84 | @pytest.mark.vcr() |
87 | def test_account_mute_unmute(api, api2): | 85 | def test_account_mute_unmute(api, api2): |
88 | api2_id = api2.account_verify_credentials().id | 86 | api2_id = api2.account_verify_credentials().id |
@@ -110,7 +108,6 @@ def test_blocks(api): | |||
110 | blocks = api.blocks() | 108 | blocks = api.blocks() |
111 | assert isinstance(blocks, list) | 109 | assert isinstance(blocks, list) |
112 | 110 | ||
113 | |||
114 | @pytest.mark.vcr(match_on=['path']) | 111 | @pytest.mark.vcr(match_on=['path']) |
115 | def test_account_update_credentials(api): | 112 | def test_account_update_credentials(api): |
116 | with open('tests/image.jpg', 'rb') as f: | 113 | with open('tests/image.jpg', 'rb') as f: |
@@ -264,3 +261,22 @@ def test_account_notes(api, api2): | |||
264 | relationship = api.account_note_set(api2.account_verify_credentials(), "top ebayer gerne wieder") | 261 | relationship = api.account_note_set(api2.account_verify_credentials(), "top ebayer gerne wieder") |
265 | assert relationship | 262 | assert relationship |
266 | assert relationship.note == "top ebayer gerne wieder" | 263 | assert relationship.note == "top ebayer gerne wieder" |
264 | |||
265 | @pytest.mark.vcr() | ||
266 | def test_follow_with_notify_reblog(api, api2, api3): | ||
267 | api2_id = api2.account_verify_credentials() | ||
268 | try: | ||
269 | api.account_follow(api2_id, notify = True, reblogs = False) | ||
270 | status1 = api3.toot("rootin tooting and shootin") | ||
271 | time.sleep(1) | ||
272 | status2 = api2.toot("horses are not real") | ||
273 | api2.status_reblog(status1) | ||
274 | time.sleep(3) | ||
275 | notifications = api.notifications() | ||
276 | timeline = api.timeline(local=True) | ||
277 | assert timeline[0].id == status2.id | ||
278 | assert notifications[0].status.id == status2.id | ||
279 | finally: | ||
280 | api.account_unfollow(api2_id) | ||
281 | api3.status_delete(status1) | ||
282 | api2.status_delete(status2) | ||
diff --git a/tests/test_notifications.py b/tests/test_notifications.py index d3f4f5c..0be81c6 100644 --- a/tests/test_notifications.py +++ b/tests/test_notifications.py | |||
@@ -34,3 +34,4 @@ def test_notifications_dismiss_pre_2_9_2(api, api2): | |||
34 | @pytest.mark.vcr() | 34 | @pytest.mark.vcr() |
35 | def test_notifications_clear(api): | 35 | def test_notifications_clear(api): |
36 | api.notifications_clear() | 36 | api.notifications_clear() |
37 | |||