From 78a1c174688d51040d76fce0b9bc7693ec985a97 Mon Sep 17 00:00:00 2001 From: halcy Date: Fri, 11 Nov 2022 00:21:00 +0200 Subject: Fix tests --- tests/cassettes/test_stream_user_local.yaml | 106 ++++++++++++++++++++-------- 1 file changed, 78 insertions(+), 28 deletions(-) (limited to 'tests/cassettes/test_stream_user_local.yaml') diff --git a/tests/cassettes/test_stream_user_local.yaml b/tests/cassettes/test_stream_user_local.yaml index b858968..58d344d 100644 --- a/tests/cassettes/test_stream_user_local.yaml +++ b/tests/cassettes/test_stream_user_local.yaml @@ -16,14 +16,14 @@ interactions: uri: http://localhost:3000/api/v1/accounts/verify_credentials response: body: - string: '{"id":"109304268902557892","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-07T00: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":9,"last_status_at":"2022-11-07","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":"109321664540352180","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-10T00: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":22,"last_status_at":"2022-11-10","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-RpcagMalPkAlKm3kX+Nigw==''; + style-src ''self'' http://localhost:3000 ''nonce-gkwjYq+LCb/KEMV2NxbshQ==''; 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/"90c8995815af51b6af3ded8c73925bc8" + - W/"fb81371f967af73d437fca77518c5b76" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -49,9 +49,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - f89a85e4-693e-4811-afe0-f48c96810a51 + - f17baa84-2686-4fd4-8098-b47257ff4139 X-Runtime: - - '0.012587' + - '0.013590' X-XSS-Protection: - 1; mode=block status: @@ -65,7 +65,7 @@ interactions: Accept-Encoding: - gzip, deflate Authorization: - - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 + - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN Connection: - keep-alive Content-Length: @@ -73,17 +73,17 @@ interactions: User-Agent: - tests/v311 method: POST - uri: http://localhost:3000/api/v1/accounts/109304268902557892/unfollow + uri: http://localhost:3000/api/v1/accounts/109321664540352180/unfollow response: body: - string: '{"id":"109304268902557892","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":"109321664540352180","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-MAcXmlpWzdjR1QngR+usSQ==''; + style-src ''self'' http://localhost:3000 ''nonce-ZrD+6y9sHNRbW9L/VrsA3A==''; 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/"8d8caa68e50963507d45a12d820e86b0" + - W/"11435fd0c88c7540ef53a1ce0f924077" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -109,9 +109,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - c46d293d-f470-4b9e-8831-885c9790b044 + - 1139f40e-3a65-4b56-803a-e51fac46dd69 X-Runtime: - - '0.011157' + - '0.018744' 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.0rc1","urls":{"streaming_api":"ws://localhost:4000"},"stats":{"user_count":4,"status_count":14,"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":25,"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-4tO2nlRskWft4h/Inu3sBQ==''; + style-src ''self'' http://localhost:3000 ''nonce-xkJypL9JuaLYvngaT4wIJQ==''; 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, 07 Nov 2022 20:27:36 GMT + - Thu, 10 Nov 2022 22:12:27 GMT ETag: - - W/"100afec8ba2625ff54d1d1079e4fd969" + - W/"e3dde204cfeb9d08fe78e070bae4265e" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -169,9 +169,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 38937a94-a112-488b-804f-93d77fdeddc7 + - 6166daa3-5622-4750-aac3-02321bca018d X-Runtime: - - '0.013652' + - '0.015218' X-XSS-Protection: - 1; mode=block status: @@ -198,18 +198,16 @@ interactions: uri: http://localhost:3000/api/v1/statuses response: body: - string: '{"id":"109304405122614430","created_at":"2022-11-07T20:27:41.369Z","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/109304405122614430","url":"http://localhost:3000/@mastodonpy_test/109304405122614430","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 + string: '{"id":"109321804346504390","created_at":"2022-11-10T22:12:32.457Z","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/109321804346504390","url":"http://localhost:3000/@mastodonpy_test/109321804346504390","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 cool guy\u003c/p\u003e","filtered":[],"reblog":null,"application":{"name":"Mastodon.py - test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"John - Lennon","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-07T00:00:00.000Z","note":"\u003cp\u003eI - walk funny\u003c/p\u003e","url":"http://localhost:3000/@mastodonpy_test","avatar":"http://localhost:3000/system/accounts/avatars/123/456/789/012/345/original/2d5ad2a2a4ca9e32.jpg","avatar_static":"http://localhost:3000/system/accounts/avatars/123/456/789/012/345/original/2d5ad2a2a4ca9e32.jpg","header":"http://localhost:3000/system/accounts/headers/123/456/789/012/345/original/51bc27ef4d67326e.jpg","header_static":"http://localhost:3000/system/accounts/headers/123/456/789/012/345/original/51bc27ef4d67326e.jpg","followers_count":0,"following_count":0,"statuses_count":6,"last_status_at":"2022-11-07","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}' + test suite","website":null},"account":{"id":"109321664748836260","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-10T00: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":4,"last_status_at":"2022-11-10","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-6fIwlj9EEY0/cPsP7RC+Dw==''; + style-src ''self'' http://localhost:3000 ''nonce-6xu0+GdCnFJ8gnEdnw9RbA==''; 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 @@ -219,7 +217,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"8382cab430d21878647eeca6662d1957" + - W/"a8fa87cb101679d598c1fc7e34d1d7fc" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -237,16 +235,68 @@ interactions: X-RateLimit-Limit: - '300' X-RateLimit-Remaining: - - '187' + - '286' X-RateLimit-Reset: - - '2022-11-07T21:00:00.390918Z' + - '2022-11-11T00:00:00.480143Z' X-Request-Id: - - c9439b68-57ce-4df5-a00b-1e2cd29b7133 + - 6bd9e7dd-82ab-4022-8820-7f8db9ae163e X-Runtime: - - '0.034771' + - '0.037645' X-XSS-Protection: - 1; mode=block status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN + Connection: + - keep-alive + User-Agent: + - tests/v311 + method: GET + uri: http://localhost:4000/api/v1/streaming/user + response: + body: + string: ':) + + event: update + + data: {"id":"109321804346504390","created_at":"2022-11-10T22:12:32.457Z","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/109321804346504390","url":"http://localhost:3000/@mastodonpy_test/109321804346504390","replies_count":0,"reblogs_count":0,"favourites_count":0,"edited_at":null,"content":"

it's + cool guy

","reblog":null,"application":{"name":"Mastodon.py test suite","website":null},"account":{"id":"109321664748836260","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":true,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-10T00: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":4,"last_status_at":"2022-11-10","noindex":false,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null,"favourited":false,"reblogged":false,"muted":false,"bookmarked":false,"pinned":false,"filtered":[]} + + + :' + headers: + Access-Control-Allow-Headers: + - Authorization, Accept, Cache-Control + Access-Control-Allow-Methods: + - GET, OPTIONS + Access-Control-Allow-Origin: + - '*' + Cache-Control: + - no-store + Connection: + - keep-alive + Content-Type: + - text/event-stream + Date: + - Thu, 10 Nov 2022 22:12:27 GMT + Keep-Alive: + - timeout=5 + Transfer-Encoding: + - chunked + X-Powered-By: + - Express + X-Request-Id: + - 9197ae8e-a5c9-4173-8794-83baf5eb3a64 + status: + code: 200 + message: OK version: 1 -- cgit v1.2.3