From 00a96c5e9584bcd768d51372fbc4ccd866432771 Mon Sep 17 00:00:00 2001 From: halcy Date: Thu, 24 Nov 2022 22:56:49 +0200 Subject: Add trending APIs --- tests/cassettes/test_trending_links.yaml | 60 ++++++++++++++ tests/cassettes/test_trending_statuses.yaml | 60 ++++++++++++++ tests/cassettes/test_trending_tags.yaml | 118 ++++++++++++++++++++++++++++ tests/cassettes/test_trends.yaml | 60 -------------- 4 files changed, 238 insertions(+), 60 deletions(-) create mode 100644 tests/cassettes/test_trending_links.yaml create mode 100644 tests/cassettes/test_trending_statuses.yaml create mode 100644 tests/cassettes/test_trending_tags.yaml delete mode 100644 tests/cassettes/test_trends.yaml (limited to 'tests/cassettes') diff --git a/tests/cassettes/test_trending_links.yaml b/tests/cassettes/test_trending_links.yaml new file mode 100644 index 0000000..3d54b25 --- /dev/null +++ b/tests/cassettes/test_trending_links.yaml @@ -0,0 +1,60 @@ +interactions: +- 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/trends/links + response: + body: + string: '[]' + 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-7UiLUEyJEVY9JgarYKBdCg==''; + 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/"4f53cda18c2baa0c0354bb5f9a3ecbe5" + 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: + - 623f9c94-2540-4c4f-b0ae-1c3db0b9ca35 + X-Runtime: + - '0.016081' + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_trending_statuses.yaml b/tests/cassettes/test_trending_statuses.yaml new file mode 100644 index 0000000..493555d --- /dev/null +++ b/tests/cassettes/test_trending_statuses.yaml @@ -0,0 +1,60 @@ +interactions: +- 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/trends/statuses + response: + body: + string: '[]' + 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-Qp9U6bbMsEloa3BOJP+ApA==''; + 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/"4f53cda18c2baa0c0354bb5f9a3ecbe5" + 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: + - 9b65a082-dbab-436e-9544-9d3ceae169b0 + X-Runtime: + - '0.022649' + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_trending_tags.yaml b/tests/cassettes/test_trending_tags.yaml new file mode 100644 index 0000000..583aeda --- /dev/null +++ b/tests/cassettes/test_trending_tags.yaml @@ -0,0 +1,118 @@ +interactions: +- 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/trends/tags + response: + body: + string: '[]' + 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-x84HIusoB0oMG/yq6Q4NDg==''; + 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/"4f53cda18c2baa0c0354bb5f9a3ecbe5" + 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: + - e26034bb-bfdb-4f3a-bbef-9d2e51f88c14 + X-Runtime: + - '0.029510' + 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/trends/tags + response: + body: + string: '[]' + 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-mRWh2zKUzi/z+WYqVSZD1g==''; + 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/"4f53cda18c2baa0c0354bb5f9a3ecbe5" + 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: + - c1cc20bc-a0b0-4ffa-bd72-686a094e1da0 + X-Runtime: + - '0.015007' + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/cassettes/test_trends.yaml b/tests/cassettes/test_trends.yaml deleted file mode 100644 index 41cf4af..0000000 --- a/tests/cassettes/test_trends.yaml +++ /dev/null @@ -1,60 +0,0 @@ -interactions: -- 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/trends - response: - body: - string: '[]' - 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-wweJU6CNiZOq8p6GOgvKMg==''; - 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/"4f53cda18c2baa0c0354bb5f9a3ecbe5" - 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: - - 04d49bc9-1ad7-48de-a189-e93e527942e0 - X-Runtime: - - '0.010606' - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -version: 1 -- cgit v1.2.3