From 8865d1123e88b4e8cd5893a7d37c49fffb960853 Mon Sep 17 00:00:00 2001 From: halcy Date: Tue, 22 Nov 2022 01:30:43 +0200 Subject: Fix some tests, fix a pleroma specific date parsing issue --- tests/cassettes/test_directory.yaml | 10 +- tests/cassettes/test_stream_user_direct.yaml | 255 +++++++++++++++++---------- tests/test_streaming.py | 11 +- 3 files changed, 179 insertions(+), 97 deletions(-) (limited to 'tests') diff --git a/tests/cassettes/test_directory.yaml b/tests/cassettes/test_directory.yaml index 1b12d54..e4ec7cb 100644 --- a/tests/cassettes/test_directory.yaml +++ b/tests/cassettes/test_directory.yaml @@ -16,14 +16,14 @@ interactions: uri: http://localhost:3000/api/v1/directory response: body: - string: '[{"id":"109383665090212021","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":"2022-11-21","noindex":false,"emojis":[],"fields":[]}]' + string: '[{"id":"109384260135049902","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}]' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-xpVs3DQUf/Qj6+scQHcj2w==''; + style-src ''self'' http://localhost:3000 ''nonce-4zQUTaGqbRq4cCv1ZKgOhw==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -33,7 +33,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"da415b35a62517444708496f746f2ca2" + - W/"4cd256c2bfbe67103f7671696dd86c2f" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -49,9 +49,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - d373f3cc-9362-450e-b7d9-06b8c0411b0d + - e421ca7a-a712-475c-9111-8e1b53b945c9 X-Runtime: - - '0.029489' + - '0.029318' X-XSS-Protection: - 1; mode=block status: diff --git a/tests/cassettes/test_stream_user_direct.yaml b/tests/cassettes/test_stream_user_direct.yaml index cbed370..1a2580f 100644 --- a/tests/cassettes/test_stream_user_direct.yaml +++ b/tests/cassettes/test_stream_user_direct.yaml @@ -16,14 +16,14 @@ interactions: uri: http://localhost:3000/api/v1/accounts/verify_credentials response: body: - string: '{"id":"109383687317384970","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"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}}' + string: '{"id":"109384259794974437","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00: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-21","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}}' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-wY5l/ItCI1m5QY5SxnGCZw==''; + style-src ''self'' http://localhost:3000 ''nonce-PummBfiGQE1JowHOPncaXw==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -33,7 +33,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"3ca9a6fde27a9a8bd854a96dcfc0e7b2" + - W/"9030ced0e8c342dd835f00ea40a0bc56" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -49,9 +49,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - c2184dff-4d3a-4c50-a9c5-ed64323b79cb + - 200e273c-3ae4-433b-ada1-6c12e09aade2 X-Runtime: - - '0.232828' + - '0.013598' X-XSS-Protection: - 1; mode=block status: @@ -73,17 +73,17 @@ interactions: User-Agent: - tests/v311 method: POST - uri: http://localhost:3000/api/v1/accounts/109383687317384970/unfollow + uri: http://localhost:3000/api/v1/accounts/109384259794974437/unfollow response: body: - string: '{"id":"109383687317384970","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":""}' + string: '{"id":"109384259794974437","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":""}' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-7XkmcTna3vWHWdCdqvvF1A==''; + style-src ''self'' http://localhost:3000 ''nonce-mQ9eRlqKjjjBk1SqgOjC/g==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -93,7 +93,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"834c827b7cfe9175d82e1a4bd08f215d" + - W/"da1368f0c6d6e731a771947b6a64ff57" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -109,9 +109,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - e115ce24-4e94-44cb-9ce0-90c331f4f4b6 + - 72c29674-374c-4245-98a1-0a2a6c9e7f94 X-Runtime: - - '0.036572' + - '0.013368' X-XSS-Protection: - 1; mode=block status: @@ -134,14 +134,14 @@ interactions: uri: http://localhost:3000/api/v1/instance/ response: body: - string: '{"uri":"localhost:3000","title":"Mastodon","short_description":"","description":"","email":"","version":"4.0.0rc2","urls":{"streaming_api":"ws://localhost:4000"},"stats":{"user_count":4,"status_count":0,"domain_count":0},"thumbnail":"http://localhost:3000/packs/media/images/preview-6399aebd96ccf025654e2977454f168f.png","languages":["en"],"registrations":true,"approval_required":false,"invites_enabled":true,"configuration":{"accounts":{"max_featured_tags":10},"statuses":{"max_characters":500,"max_media_attachments":4,"characters_reserved_per_url":23},"media_attachments":{"supported_mime_types":["image/jpeg","image/png","image/gif","image/heic","image/heif","image/webp","image/avif","video/webm","video/mp4","video/quicktime","video/ogg","audio/wave","audio/wav","audio/x-wav","audio/x-pn-wave","audio/vnd.wave","audio/ogg","audio/vorbis","audio/mpeg","audio/mp3","audio/webm","audio/flac","audio/aac","audio/m4a","audio/x-m4a","audio/mp4","audio/3gpp","video/x-ms-asf"],"image_size_limit":10485760,"image_matrix_limit":16777216,"video_size_limit":41943040,"video_frame_rate_limit":60,"video_matrix_limit":2304000},"polls":{"max_options":4,"max_characters_per_option":50,"min_expiration":300,"max_expiration":2629746}},"contact_account":null,"rules":[]}' + string: '{"uri":"localhost:3000","title":"Mastodon","short_description":"","description":"","email":"","version":"4.0.0rc2","urls":{"streaming_api":"ws://localhost:4000"},"stats":{"user_count":4,"status_count":6,"domain_count":0},"thumbnail":"http://localhost:3000/packs/media/images/preview-6399aebd96ccf025654e2977454f168f.png","languages":["en"],"registrations":true,"approval_required":false,"invites_enabled":true,"configuration":{"accounts":{"max_featured_tags":10},"statuses":{"max_characters":500,"max_media_attachments":4,"characters_reserved_per_url":23},"media_attachments":{"supported_mime_types":["image/jpeg","image/png","image/gif","image/heic","image/heif","image/webp","image/avif","video/webm","video/mp4","video/quicktime","video/ogg","audio/wave","audio/wav","audio/x-wav","audio/x-pn-wave","audio/vnd.wave","audio/ogg","audio/vorbis","audio/mpeg","audio/mp3","audio/webm","audio/flac","audio/aac","audio/m4a","audio/x-m4a","audio/mp4","audio/3gpp","video/x-ms-asf"],"image_size_limit":10485760,"image_matrix_limit":16777216,"video_size_limit":41943040,"video_frame_rate_limit":60,"video_matrix_limit":2304000},"polls":{"max_options":4,"max_characters_per_option":50,"min_expiration":300,"max_expiration":2629746}},"contact_account":null,"rules":[]}' headers: Cache-Control: - max-age=180, public Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-aeAGJ5RU2r+vOcMDj/uqkQ==''; + style-src ''self'' http://localhost:3000 ''nonce-U3QtyYYcypf+1xBBLM3HEw==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -151,9 +151,9 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Mon, 21 Nov 2022 20:30:32 GMT + - Mon, 21 Nov 2022 23:06:14 GMT ETag: - - W/"6de86e074f529b0074f74528eee15b7a" + - W/"02f6de447b58c8ef38800346c358b5d4" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -169,9 +169,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 9942f96e-b48c-4254-9920-7ed4e81e37f1 + - c93447da-a8ec-4dc3-afae-a011e375da73 X-Runtime: - - '0.032940' + - '0.014802' X-XSS-Protection: - 1; mode=block status: @@ -194,14 +194,14 @@ interactions: uri: http://localhost:3000/api/v1/instance/ response: body: - string: '{"uri":"localhost:3000","title":"Mastodon","short_description":"","description":"","email":"","version":"4.0.0rc2","urls":{"streaming_api":"ws://localhost:4000"},"stats":{"user_count":4,"status_count":0,"domain_count":0},"thumbnail":"http://localhost:3000/packs/media/images/preview-6399aebd96ccf025654e2977454f168f.png","languages":["en"],"registrations":true,"approval_required":false,"invites_enabled":true,"configuration":{"accounts":{"max_featured_tags":10},"statuses":{"max_characters":500,"max_media_attachments":4,"characters_reserved_per_url":23},"media_attachments":{"supported_mime_types":["image/jpeg","image/png","image/gif","image/heic","image/heif","image/webp","image/avif","video/webm","video/mp4","video/quicktime","video/ogg","audio/wave","audio/wav","audio/x-wav","audio/x-pn-wave","audio/vnd.wave","audio/ogg","audio/vorbis","audio/mpeg","audio/mp3","audio/webm","audio/flac","audio/aac","audio/m4a","audio/x-m4a","audio/mp4","audio/3gpp","video/x-ms-asf"],"image_size_limit":10485760,"image_matrix_limit":16777216,"video_size_limit":41943040,"video_frame_rate_limit":60,"video_matrix_limit":2304000},"polls":{"max_options":4,"max_characters_per_option":50,"min_expiration":300,"max_expiration":2629746}},"contact_account":null,"rules":[]}' + string: '{"uri":"localhost:3000","title":"Mastodon","short_description":"","description":"","email":"","version":"4.0.0rc2","urls":{"streaming_api":"ws://localhost:4000"},"stats":{"user_count":4,"status_count":6,"domain_count":0},"thumbnail":"http://localhost:3000/packs/media/images/preview-6399aebd96ccf025654e2977454f168f.png","languages":["en"],"registrations":true,"approval_required":false,"invites_enabled":true,"configuration":{"accounts":{"max_featured_tags":10},"statuses":{"max_characters":500,"max_media_attachments":4,"characters_reserved_per_url":23},"media_attachments":{"supported_mime_types":["image/jpeg","image/png","image/gif","image/heic","image/heif","image/webp","image/avif","video/webm","video/mp4","video/quicktime","video/ogg","audio/wave","audio/wav","audio/x-wav","audio/x-pn-wave","audio/vnd.wave","audio/ogg","audio/vorbis","audio/mpeg","audio/mp3","audio/webm","audio/flac","audio/aac","audio/m4a","audio/x-m4a","audio/mp4","audio/3gpp","video/x-ms-asf"],"image_size_limit":10485760,"image_matrix_limit":16777216,"video_size_limit":41943040,"video_frame_rate_limit":60,"video_matrix_limit":2304000},"polls":{"max_options":4,"max_characters_per_option":50,"min_expiration":300,"max_expiration":2629746}},"contact_account":null,"rules":[]}' headers: Cache-Control: - max-age=180, public Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-U4Ok3r+Da+UekNvECNdkBg==''; + style-src ''self'' http://localhost:3000 ''nonce-QaX7+0ROjZrSMxRe26bZHg==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -211,9 +211,9 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Mon, 21 Nov 2022 20:30:32 GMT + - Mon, 21 Nov 2022 23:06:14 GMT ETag: - - W/"6de86e074f529b0074f74528eee15b7a" + - W/"02f6de447b58c8ef38800346c358b5d4" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -229,9 +229,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - f1129b94-ef1c-4974-906c-e8686f5b49cb + - 9e456d84-8614-46c8-a8c5-9e045765a79c X-Runtime: - - '0.014735' + - '0.014128' X-XSS-Protection: - 1; mode=block status: @@ -258,16 +258,16 @@ interactions: uri: http://localhost:3000/api/v1/statuses response: body: - string: '{"id":"109383689004693346","created_at":"2022-11-21T20:30:37.415Z","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/109383689004693346","url":"http://localhost:3000/@mastodonpy_test/109383689004693346","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eonly + string: '{"id":"109384301257266974","created_at":"2022-11-21T23:06:19.635Z","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/109384301257266974","url":"http://localhost:3000/@mastodonpy_test/109384301257266974","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eonly real cars respond.\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687546708201","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + test suite","website":null},"account":{"id":"109384260022953307","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-Nug5j0k35i73b5/xZpDzSw==''; + style-src ''self'' http://localhost:3000 ''nonce-e2z1j+qCpIi6ImHwX+NssA==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -277,7 +277,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"06e532d7d1a0ea9f11ff0ca23b2eaf68" + - W/"65e269b9dbd60321d97663af0f504bbd" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -295,13 +295,13 @@ interactions: X-RateLimit-Limit: - '300' X-RateLimit-Remaining: - - '299' + - '293' X-RateLimit-Reset: - - '2022-11-21T21:00:00.488905Z' + - '2022-11-22T00:00:00.668313Z' X-Request-Id: - - d58b0ca3-9915-496e-9561-0bffa479cfc8 + - 86478fc3-dfe6-49d9-8c8b-3693ad673da8 X-Runtime: - - '0.121218' + - '0.047040' X-XSS-Protection: - 1; mode=block status: @@ -328,18 +328,18 @@ interactions: uri: http://localhost:3000/api/v1/statuses response: body: - string: '{"id":"109383689011592842","created_at":"2022-11-21T20:30:37.506Z","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/109383689011592842","url":"http://localhost:3000/@admin/109383689011592842","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003e\u003cspan + string: '{"id":"109384301260589758","created_at":"2022-11-21T23:06:19.685Z","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/109384301260589758","url":"http://localhost:3000/@admin/109384301260589758","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003e\u003cspan class=\"h-card\"\u003e\u003ca href=\"http://localhost:3000/@mastodonpy_test\" class=\"u-url mention\"\u003e@\u003cspan\u003emastodonpy_test\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e beep beep I\u0026#39;m a jeep\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687317384970","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00: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":1,"last_status_at":"2022-11-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109383687546708201","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}' + test suite","website":null},"account":{"id":"109384259794974437","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00: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":7,"last_status_at":"2022-11-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109384260022953307","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-pNk38vviNrOaxb42+nKYNg==''; + style-src ''self'' http://localhost:3000 ''nonce-6itUfAgqd9qY7S5zx/+qXw==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -349,7 +349,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"ce33df9a4501857c86d0dd6b52a59d4c" + - W/"5e2c779d68e0b766e8082edb20856d81" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -367,13 +367,13 @@ interactions: X-RateLimit-Limit: - '300' X-RateLimit-Remaining: - - '299' + - '290' X-RateLimit-Reset: - - '2022-11-21T21:00:00.541345Z' + - '2022-11-22T00:00:00.768948Z' X-Request-Id: - - dacf0d9b-bbae-48e8-bd27-ca90ff5debae + - decb1060-87d7-4e35-b686-e6533e5a216a X-Runtime: - - '0.047972' + - '0.096219' X-XSS-Protection: - 1; mode=block status: @@ -400,16 +400,16 @@ interactions: uri: http://localhost:3000/api/v1/statuses response: body: - string: '{"id":"109383689015957568","created_at":"2022-11-21T20:30:37.574Z","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/109383689015957568","url":"http://localhost:3000/@admin/109383689015957568","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eon + string: '{"id":"109384301267183553","created_at":"2022-11-21T23:06:19.785Z","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/109384301267183553","url":"http://localhost:3000/@admin/109384301267183553","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eon the internet, nobody knows you\u0026#39;re a plane\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687317384970","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00: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":2,"last_status_at":"2022-11-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + test suite","website":null},"account":{"id":"109384259794974437","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00: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":8,"last_status_at":"2022-11-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-AKoo2WqF9VDBOsCwVWqEhw==''; + style-src ''self'' http://localhost:3000 ''nonce-8SXWqBr3qM3cmbOb5L0Q6g==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -419,7 +419,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"66b8c9259455598a9e9464f1afacd306" + - W/"19358313ef9711d626c1aa1e1a665bf8" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -437,13 +437,13 @@ interactions: X-RateLimit-Limit: - '300' X-RateLimit-Remaining: - - '298' + - '289' X-RateLimit-Reset: - - '2022-11-21T21:00:00.600086Z' + - '2022-11-22T00:00:00.817705Z' X-Request-Id: - - c90cd0bb-8980-4129-b951-246a7fcd5b91 + - 7d13a293-c072-4b44-9334-2a9ad2487d96 X-Runtime: - - '0.053851' + - '0.044362' X-XSS-Protection: - 1; mode=block status: @@ -470,18 +470,18 @@ interactions: uri: http://localhost:3000/api/v1/statuses response: body: - string: '{"id":"109383689018917158","created_at":"2022-11-21T20:30:37.619Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"direct","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/109383689018917158","url":"http://localhost:3000/@mastodonpy_test/109383689018917158","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003e\u003cspan + string: '{"id":"109384301270458447","created_at":"2022-11-21T23:06:19.835Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"direct","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/109384301270458447","url":"http://localhost:3000/@mastodonpy_test/109384301270458447","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003e\u003cspan class=\"h-card\"\u003e\u003ca href=\"http://localhost:3000/@mastodonpy_test_2\" class=\"u-url mention\"\u003e@\u003cspan\u003emastodonpy_test_2\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e pssssst\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687546708201","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109383687660136038","username":"mastodonpy_test_2","url":"http://localhost:3000/@mastodonpy_test_2","acct":"mastodonpy_test_2"}],"tags":[],"emojis":[],"card":null,"poll":null}' + test suite","website":null},"account":{"id":"109384260022953307","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109384260135049902","username":"mastodonpy_test_2","url":"http://localhost:3000/@mastodonpy_test_2","acct":"mastodonpy_test_2"}],"tags":[],"emojis":[],"card":null,"poll":null}' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-cwicODBt6bNPz9mKf11E5Q==''; + style-src ''self'' http://localhost:3000 ''nonce-Sxvfe0YcGzkMUxPI6IbhrQ==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -491,7 +491,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"5ea2b5082e48d942ecd2ec08dafa4ac1" + - W/"ff2a76a7dee12c5b949e5eacb3a9280f" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -509,20 +509,20 @@ interactions: X-RateLimit-Limit: - '300' X-RateLimit-Remaining: - - '298' + - '292' X-RateLimit-Reset: - - '2022-11-21T21:00:00.645869Z' + - '2022-11-22T00:00:00.878336Z' X-Request-Id: - - 1e2141ee-72fd-4c87-9faa-7b51fb015a0f + - a04e886b-8a4a-40d1-9429-83e7b10bf88c X-Runtime: - - '0.041215' + - '0.055913' X-XSS-Protection: - 1; mode=block status: code: 200 message: OK - request: - body: status=%40mastodonpy_test+pssssst%21&in_reply_to_id=109383689018917158&visibility=direct + body: status=%40mastodonpy_test+pssssst%21&in_reply_to_id=109384301270458447&visibility=direct headers: Accept: - '*/*' @@ -542,18 +542,18 @@ interactions: uri: http://localhost:3000/api/v1/statuses response: body: - string: '{"id":"109383689022578579","created_at":"2022-11-21T20:30:37.674Z","in_reply_to_id":"109383689018917158","in_reply_to_account_id":"109383687546708201","sensitive":false,"spoiler_text":"","visibility":"direct","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test_2/statuses/109383689022578579","url":"http://localhost:3000/@mastodonpy_test_2/109383689022578579","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003e\u003cspan + string: '{"id":"109384301340129379","created_at":"2022-11-21T23:06:20.898Z","in_reply_to_id":"109384301270458447","in_reply_to_account_id":"109384260022953307","sensitive":false,"spoiler_text":"","visibility":"direct","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test_2/statuses/109384301340129379","url":"http://localhost:3000/@mastodonpy_test_2/109384301340129379","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"\u003cp\u003e\u003cspan class=\"h-card\"\u003e\u003ca href=\"http://localhost:3000/@mastodonpy_test\" class=\"u-url mention\"\u003e@\u003cspan\u003emastodonpy_test\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e pssssst!\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687660136038","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109383687546708201","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}' + test suite","website":null},"account":{"id":"109384260135049902","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109384260022953307","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-eXjkNPoUkWX6zmECuBg3xQ==''; + style-src ''self'' http://localhost:3000 ''nonce-S3YxdYtDVgWPKUJTp8S/eA==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -563,7 +563,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"5cd48c5e98ddd015159fc495162768b6" + - W/"88c5888d1bebe6f6ef6307c8bb3c7555" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -581,13 +581,83 @@ interactions: X-RateLimit-Limit: - '300' X-RateLimit-Remaining: - - '299' + - '296' X-RateLimit-Reset: - - '2022-11-21T21:00:00.702116Z' + - '2022-11-22T00:00:00.947210Z' X-Request-Id: - - 82bf9922-2f25-4d2b-9602-b6a705f51c15 + - b8190f9b-4896-4039-8e26-0cd102057291 X-Runtime: - - '0.051019' + - '0.061954' + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: status=only+real+animals+respond. + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN + Connection: + - keep-alive + Content-Length: + - '33' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - tests/v311 + method: PUT + uri: http://localhost:3000/api/v1/statuses/109384301257266974 + response: + body: + string: '{"id":"109384301257266974","created_at":"2022-11-21T23:06:19.635Z","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/109384301257266974","url":"http://localhost:3000/@mastodonpy_test/109384301257266974","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":"2022-11-21T23:06:22.970Z","favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"content":"\u003cp\u003eonly + real animals respond.\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"109384260022953307","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + headers: + Cache-Control: + - no-store + Content-Security-Policy: + - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src + ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; + style-src ''self'' http://localhost:3000 ''nonce-4/MO67mpdp/FVNcOR/ji1g==''; + media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' + https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' + data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 + ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' + ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; + worker-src ''self'' blob: http://localhost:3000' + Content-Type: + - application/json; charset=utf-8 + ETag: + - W/"d2f4496aaed8fc36db6b027b9ba0fdfe" + Referrer-Policy: + - strict-origin-when-cross-origin + Transfer-Encoding: + - chunked + Vary: + - Accept, Origin + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-RateLimit-Limit: + - '300' + X-RateLimit-Remaining: + - '291' + X-RateLimit-Reset: + - '2022-11-22T00:00:00.998619Z' + X-Request-Id: + - 120fea85-1265-4206-aebe-e4aab5e42a43 + X-Runtime: + - '0.044130' X-XSS-Protection: - 1; mode=block status: @@ -609,19 +679,19 @@ interactions: User-Agent: - tests/v311 method: DELETE - uri: http://localhost:3000/api/v1/statuses/109383689004693346 + uri: http://localhost:3000/api/v1/statuses/109384301257266974 response: body: - string: '{"id":"109383689004693346","created_at":"2022-11-21T20:30:37.415Z","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/109383689004693346","url":"http://localhost:3000/@mastodonpy_test/109383689004693346","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"only - real cars respond.","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687546708201","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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":0,"last_status_at":"2022-11-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' + string: '{"id":"109384301257266974","created_at":"2022-11-21T23:06:19.635Z","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/109384301257266974","url":"http://localhost:3000/@mastodonpy_test/109384301257266974","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":"2022-11-21T23:06:22.970Z","favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"text":"only + real animals respond.","filtered":[],"reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"109384260022953307","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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":0,"last_status_at":"2022-11-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}' headers: Cache-Control: - no-store Content-Security-Policy: - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; - style-src ''self'' http://localhost:3000 ''nonce-pVcQnLw/6eiOtng2wmJViA==''; + style-src ''self'' http://localhost:3000 ''nonce-pVZzjqxTRTMsUe7KjE64kg==''; media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 @@ -631,7 +701,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"090808ac368376930dcec847c8714838" + - W/"816a09fc70944fe293182a477becbaf5" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -647,9 +717,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - abb29577-b3c2-472d-9b48-297ca1a18b43 + - 4540ff16-9b27-4db6-a6ff-03717cbbf7b8 X-Runtime: - - '0.030526' + - '0.026664' X-XSS-Protection: - 1; mode=block status: @@ -676,38 +746,45 @@ interactions: event: update - data: {"id":"109383689004693346","created_at":"2022-11-21T20:30:37.415Z","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/109383689004693346","url":"http://localhost:3000/@mastodonpy_test/109383689004693346","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"content":"

only + data: {"id":"109384301257266974","created_at":"2022-11-21T23:06:19.635Z","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/109384301257266974","url":"http://localhost:3000/@mastodonpy_test/109384301257266974","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"content":"

only real cars respond.

","reblog":null,"application":{"name":"Mastodon.py test - suite","website":null},"account":{"id":"109383687546708201","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"filtered":[]} + suite","website":null},"account":{"id":"109384260022953307","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"filtered":[]} event: notification - data: {"id":"6","type":"mention","created_at":"2022-11-21T20:30:38.306Z","account":{"id":"109383687317384970","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00: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":2,"last_status_at":"2022-11-21","noindex":false,"emojis":[],"fields":[]},"status":{"id":"109383689011592842","created_at":"2022-11-21T20:30:37.506Z","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/109383689011592842","url":"http://localhost:3000/@admin/109383689011592842","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"

@mastodonpy_test beep beep I'm a jeep

","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687317384970","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00: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":2,"last_status_at":"2022-11-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109383687546708201","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}} + test suite","website":null},"account":{"id":"109384259794974437","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00: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":8,"last_status_at":"2022-11-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109384260022953307","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}} event: update - data: {"id":"109383689018917158","created_at":"2022-11-21T20:30:37.619Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"direct","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/109383689018917158","url":"http://localhost:3000/@mastodonpy_test/109383689018917158","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"content":"

@mastodonpy_test_2 pssssst

","reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687546708201","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109383687660136038","username":"mastodonpy_test_2","url":"http://localhost:3000/@mastodonpy_test_2","acct":"mastodonpy_test_2"}],"tags":[],"emojis":[],"card":null,"poll":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"filtered":[]} + test suite","website":null},"account":{"id":"109384260022953307","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109384260135049902","username":"mastodonpy_test_2","url":"http://localhost:3000/@mastodonpy_test_2","acct":"mastodonpy_test_2"}],"tags":[],"emojis":[],"card":null,"poll":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"filtered":[]} event: notification - data: {"id":"8","type":"mention","created_at":"2022-11-21T20:30:38.566Z","account":{"id":"109383687660136038","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]},"status":{"id":"109383689022578579","created_at":"2022-11-21T20:30:37.674Z","in_reply_to_id":"109383689018917158","in_reply_to_account_id":"109383687546708201","sensitive":false,"spoiler_text":"","visibility":"direct","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test_2/statuses/109383689022578579","url":"http://localhost:3000/@mastodonpy_test_2/109383689022578579","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"

@mastodonpy_test pssssst!

","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687660136038","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109383687546708201","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}} + test suite","website":null},"account":{"id":"109384260135049902","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109384260022953307","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}} + + + event: status.update + + data: {"id":"109384301257266974","created_at":"2022-11-21T23:06:19.635Z","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/109384301257266974","url":"http://localhost:3000/@mastodonpy_test/109384301257266974","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":"2022-11-21T23:06:22.970Z","content":"

only + real animals respond.

","reblog":null,"application":{"name":"Mastodon.py + test suite","website":null},"account":{"id":"109384260022953307","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"filtered":[]} event: delete - data: 109383689004693346 + data: 109384301257266974 :' @@ -725,7 +802,7 @@ interactions: Content-Type: - text/event-stream Date: - - Mon, 21 Nov 2022 20:30:32 GMT + - Mon, 21 Nov 2022 23:06:14 GMT Keep-Alive: - timeout=5 Transfer-Encoding: @@ -733,7 +810,7 @@ interactions: X-Powered-By: - Express X-Request-Id: - - 1c89d969-2e4e-43ad-a6f3-bad83b7601dc + - 35ba0be9-ecdf-452c-b427-78fdd4701b68 status: code: 200 message: OK @@ -758,18 +835,18 @@ interactions: event: conversation - data: {"id":"1","unread":false,"accounts":[{"id":"109383687660136038","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}],"last_status":{"id":"109383689018917158","created_at":"2022-11-21T20:30:37.619Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"direct","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test/statuses/109383689018917158","url":"http://localhost:3000/@mastodonpy_test/109383689018917158","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"

@mastodonpy_test_2 pssssst

","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687546708201","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109383687660136038","username":"mastodonpy_test_2","url":"http://localhost:3000/@mastodonpy_test_2","acct":"mastodonpy_test_2"}],"tags":[],"emojis":[],"card":null,"poll":null}} + test suite","website":null},"account":{"id":"109384260022953307","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-21T00:00:00.000Z","note":"","url":"http://localhost:3000/@mastodonpy_test","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-21","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109384260135049902","username":"mastodonpy_test_2","url":"http://localhost:3000/@mastodonpy_test_2","acct":"mastodonpy_test_2"}],"tags":[],"emojis":[],"card":null,"poll":null}} event: conversation - data: {"id":"1","unread":true,"accounts":[{"id":"109383687660136038","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]}],"last_status":{"id":"109383689022578579","created_at":"2022-11-21T20:30:37.674Z","in_reply_to_id":"109383689018917158","in_reply_to_account_id":"109383687546708201","sensitive":false,"spoiler_text":"","visibility":"direct","language":"ja","uri":"http://localhost:3000/users/mastodonpy_test_2/statuses/109383689022578579","url":"http://localhost:3000/@mastodonpy_test_2/109383689022578579","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"content":"

@mastodonpy_test pssssst!

","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"109383687660136038","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109383687546708201","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}} + test suite","website":null},"account":{"id":"109384260135049902","username":"mastodonpy_test_2","acct":"mastodonpy_test_2","display_name":"","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2022-11-21T00: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":0,"last_status_at":null,"noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"109384260022953307","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}} :' @@ -787,7 +864,7 @@ interactions: Content-Type: - text/event-stream Date: - - Mon, 21 Nov 2022 20:30:32 GMT + - Mon, 21 Nov 2022 23:06:14 GMT Keep-Alive: - timeout=5 Transfer-Encoding: @@ -795,7 +872,7 @@ interactions: X-Powered-By: - Express X-Request-Id: - - 40898f6e-ad70-4108-b775-8c17a63346fe + - 82206929-26c7-4964-8c65-58107d5c6b6c status: code: 200 message: OK diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 721fabc..9b96ab8 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -321,13 +321,14 @@ def test_stream_user_direct(api, api2, api3): notifications = [] deletes = [] conversations = [] + edits = [] listener = CallbackStreamListener( update_handler = lambda x: updates.append(x), local_update_handler = lambda x: local_updates.append(x), notification_handler = lambda x: notifications.append(x), delete_handler = lambda x: deletes.append(x), conversation_handler = lambda x: conversations.append(x), - status_update_handler = lambda x: 0, # TODO + status_update_handler = lambda x: edits.append(x), filters_changed_handler = lambda x: 0, announcement_handler = lambda x: 0, announcement_reaction_handler = lambda x: 0, @@ -342,10 +343,13 @@ def test_stream_user_direct(api, api2, api3): posted.append(api2.status_post("@mastodonpy_test beep beep I'm a jeep")) posted.append(api2.status_post("on the internet, nobody knows you're a plane")) posted.append(api.status_post("@mastodonpy_test_2 pssssst", visibility="direct")) + time.sleep(1) posted.append(api3.status_post("@mastodonpy_test pssssst!", visibility="direct", in_reply_to_id=posted[-1])) + time.sleep(2) + api.status_update(posted[0], "only real animals respond.") time.sleep(1) api.status_delete(posted[0]) - time.sleep(10) + time.sleep(7) streaming_close() t = threading.Thread(args=(), target=do_activities) @@ -353,7 +357,7 @@ def test_stream_user_direct(api, api2, api3): stream = api.stream_user(listener, run_async=True) stream2 = api.stream_direct(listener, run_async=True) - time.sleep(20) + time.sleep(25) stream.close() stream2.close() @@ -362,6 +366,7 @@ def test_stream_user_direct(api, api2, api3): assert len(notifications) == 2 assert len(deletes) == 1 assert len(conversations) == 2 + assert len(edits) == 1 assert updates[0].id == posted[0].id assert deletes[0] == posted[0].id -- cgit v1.2.3