From b1e1ec7bdc9e84ecd31626f1a4fbf645e84d0bb2 Mon Sep 17 00:00:00 2001 From: halcy Date: Sun, 13 Nov 2022 15:33:10 +0200 Subject: Add support for timed mutes, fix tests to actually pass with new setup --- tests/cassettes/test_account_mute_unmute.yaml | 206 ++++++++++++++++++++++++-- 1 file changed, 194 insertions(+), 12 deletions(-) (limited to 'tests/cassettes/test_account_mute_unmute.yaml') diff --git a/tests/cassettes/test_account_mute_unmute.yaml b/tests/cassettes/test_account_mute_unmute.yaml index 12fd919..367df9f 100644 --- a/tests/cassettes/test_account_mute_unmute.yaml +++ b/tests/cassettes/test_account_mute_unmute.yaml @@ -1,4 +1,62 @@ interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 + Connection: + - keep-alive + User-Agent: + - tests/v311 + method: GET + uri: http://localhost:3000/api/v1/accounts/verify_credentials + response: + body: + 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":3,"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}}' + 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-Q56EkUsqZSY9zBV4LxnnIw==''; + 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/"80d63625bd23e8fc4a88c4c4a0159382" + 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-Request-Id: + - 86cfed31-61ff-45b7-a7d7-e96debf43eaa + X-Runtime: + - '0.012205' + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK - request: body: notifications=1 headers: @@ -17,17 +75,18 @@ interactions: User-Agent: - tests/v311 method: POST - uri: http://localhost:3000/api/v1/accounts/1234567890123457/mute + uri: http://localhost:3000/api/v1/accounts/109336623096259500/mute response: body: - string: '{"id":"1234567890123457","following":false,"showing_reblogs":false,"notifying":false,"languages":null,"followed_by":false,"blocking":false,"blocked_by":false,"muting":true,"muting_notifications":true,"requested":false,"domain_blocking":false,"endorsed":false,"note":""}' + string: '{"id":"109336623096259500","following":false,"showing_reblogs":false,"notifying":false,"languages":null,"followed_by":false,"blocking":false,"blocked_by":false,"muting":true,"muting_notifications":true,"requested":false,"domain_blocking":false,"endorsed":false,"note":"top + ebayer gerne wieder"}' 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-kRuUFNBUP6nsamzoP5n1cQ==''; + style-src ''self'' http://localhost:3000 ''nonce-HoZ3g1XFgO5ckiXUyMUFIA==''; 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 @@ -37,7 +96,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"5b5f68b612064b5a0b16d8640f9945e5" + - W/"a8000ce3ba487d15194daa652517ab8c" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -53,9 +112,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 0cb4e62e-0fc5-49c3-81bd-d30f4f773b17 + - 170b51ba-f1e2-4abf-98ec-06e9304a42a2 X-Runtime: - - '0.024410' + - '0.024812' X-XSS-Protection: - 1; mode=block status: @@ -77,17 +136,140 @@ interactions: User-Agent: - tests/v311 method: POST - uri: http://localhost:3000/api/v1/accounts/1234567890123457/unmute + uri: http://localhost:3000/api/v1/accounts/109336623096259500/unmute + response: + body: + 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 + ebayer gerne wieder"}' + 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-trgxItZOBuI/lh7d7b66Lw==''; + 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/"fc5fa4da9317772baa3b6968b8c31a68" + 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-Request-Id: + - 85ada05a-7d79-47b8-8cf0-8de2a49016d9 + X-Runtime: + - '0.014327' + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: notifications=1&duration=3 + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN + Connection: + - keep-alive + Content-Length: + - '26' + Content-Type: + - application/x-www-form-urlencoded + User-Agent: + - tests/v311 + method: POST + uri: http://localhost:3000/api/v1/accounts/109336623096259500/mute + response: + body: + string: '{"id":"109336623096259500","following":false,"showing_reblogs":false,"notifying":false,"languages":null,"followed_by":false,"blocking":false,"blocked_by":false,"muting":true,"muting_notifications":true,"requested":false,"domain_blocking":false,"endorsed":false,"note":"top + ebayer gerne wieder"}' + 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-ulKAN35tFR8w47vwDv+M+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 + 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/"a8000ce3ba487d15194daa652517ab8c" + 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-Request-Id: + - def180f2-31d5-4143-8269-e67a60a673f6 + X-Runtime: + - '0.014845' + 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:3000/api/v1/accounts/relationships?id=109336623096259500 response: body: - string: '{"id":"1234567890123457","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":"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 + ebayer gerne wieder"}]' 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-RMC81XA1B7bj9LHMZ8X13A==''; + style-src ''self'' http://localhost:3000 ''nonce-pmSOPUJBqwKiXv/slHjKaw==''; 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 @@ -97,7 +279,7 @@ interactions: Content-Type: - application/json; charset=utf-8 ETag: - - W/"25b4d9d745f6bc92c8314562f7461bc8" + - W/"12de70d09cb081f282f9744599b401c5" Referrer-Policy: - strict-origin-when-cross-origin Transfer-Encoding: @@ -113,9 +295,9 @@ interactions: X-Permitted-Cross-Domain-Policies: - none X-Request-Id: - - 19824469-7a36-4850-b52a-8497e4c40c77 + - fd9a7f4d-42bf-496f-aed2-ed6517bd6754 X-Runtime: - - '0.021933' + - '0.010676' X-XSS-Protection: - 1; mode=block status: -- cgit v1.2.3