From 2d81e9b2cbd3e3c1abd3a472220c667e89b29f5e Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Mon, 30 Jul 2018 23:08:30 +0200 Subject: Add filter tests --- tests/cassettes/test_filter_create.yaml | 232 ++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 tests/cassettes/test_filter_create.yaml (limited to 'tests/cassettes/test_filter_create.yaml') diff --git a/tests/cassettes/test_filter_create.yaml b/tests/cassettes/test_filter_create.yaml new file mode 100644 index 0000000..626d665 --- /dev/null +++ b/tests/cassettes/test_filter_create.yaml @@ -0,0 +1,232 @@ +interactions: +- request: + body: whole_word=1&irreversible=0&phrase=anime&context%5B%5D=notifications + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN] + Connection: [keep-alive] + Content-Length: ['68'] + Content-Type: [application/x-www-form-urlencoded] + User-Agent: [python-requests/2.18.4] + method: POST + uri: http://localhost:3000/api/v1/filters + response: + body: {string: '{"id":19,"phrase":"anime","context":["notifications"],"whole_word":true,"expires_at":null,"irreversible":false}'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"1cc3da37e6a9f5aa88132ddc5b7b063d"] + Referrer-Policy: [strict-origin-when-cross-origin] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Download-Options: [noopen] + X-Frame-Options: [SAMEORIGIN] + X-Permitted-Cross-Domain-Policies: [none] + X-Request-Id: [7047db02-fe84-4c31-84d5-3da343408027] + X-Runtime: ['0.038570'] + X-XSS-Protection: [1; mode=block] + content-length: ['111'] + 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: [python-requests/2.18.4] + method: GET + uri: http://localhost:3000/api/v1/filters + response: + body: {string: '[{"id":1,"phrase":"anime","context":["notifications"],"whole_word":true,"expires_at":null,"irreversible":true},{"id":19,"phrase":"anime","context":["notifications"],"whole_word":true,"expires_at":null,"irreversible":false}]'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"8c26a5b6dd365532b24a068190d326b6"] + Referrer-Policy: [strict-origin-when-cross-origin] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Download-Options: [noopen] + X-Frame-Options: [SAMEORIGIN] + X-Permitted-Cross-Domain-Policies: [none] + X-Request-Id: [e7994444-9983-4e61-91ea-9ecd18cf2de6] + X-Runtime: ['0.018644'] + X-XSS-Protection: [1; mode=block] + content-length: ['223'] + 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: [python-requests/2.18.4] + method: GET + uri: http://localhost:3000/api/v1/filters/19 + response: + body: {string: '{"id":19,"phrase":"anime","context":["notifications"],"whole_word":true,"expires_at":null,"irreversible":false}'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"1cc3da37e6a9f5aa88132ddc5b7b063d"] + Referrer-Policy: [strict-origin-when-cross-origin] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Download-Options: [noopen] + X-Frame-Options: [SAMEORIGIN] + X-Permitted-Cross-Domain-Policies: [none] + X-Request-Id: [beaa5303-23ff-42db-ac05-088421eae737] + X-Runtime: ['0.024738'] + X-XSS-Protection: [1; mode=block] + content-length: ['111'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN] + Connection: [keep-alive] + Content-Length: ['0'] + User-Agent: [python-requests/2.18.4] + method: DELETE + uri: http://localhost:3000/api/v1/filters/19 + response: + body: {string: '{}'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"65c2866b436b8d37236fba79638e73d5"] + Referrer-Policy: [strict-origin-when-cross-origin] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Download-Options: [noopen] + X-Frame-Options: [SAMEORIGIN] + X-Permitted-Cross-Domain-Policies: [none] + X-Request-Id: [c55605aa-c532-4e80-b7eb-2a2001245a37] + X-Runtime: ['0.032768'] + X-XSS-Protection: [1; mode=block] + content-length: ['2'] + status: {code: 200, message: OK} +- request: + body: whole_word=0&irreversible=0&phrase=anime&context%5B%5D=notifications + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN] + Connection: [keep-alive] + Content-Length: ['68'] + Content-Type: [application/x-www-form-urlencoded] + User-Agent: [python-requests/2.18.4] + method: POST + uri: http://localhost:3000/api/v1/filters + response: + body: {string: '{"id":20,"phrase":"anime","context":["notifications"],"whole_word":false,"expires_at":null,"irreversible":false}'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"7c314c3f632dfc88cf3900669c341d1d"] + Referrer-Policy: [strict-origin-when-cross-origin] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Download-Options: [noopen] + X-Frame-Options: [SAMEORIGIN] + X-Permitted-Cross-Domain-Policies: [none] + X-Request-Id: [d75504c9-52ae-442a-a9b1-d32e221e66da] + X-Runtime: ['0.029893'] + X-XSS-Protection: [1; mode=block] + content-length: ['112'] + 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: [python-requests/2.18.4] + method: GET + uri: http://localhost:3000/api/v1/filters + response: + body: {string: '[{"id":1,"phrase":"anime","context":["notifications"],"whole_word":true,"expires_at":null,"irreversible":true},{"id":20,"phrase":"anime","context":["notifications"],"whole_word":false,"expires_at":null,"irreversible":false}]'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"90390dfa2fbd844349196815a458d7d1"] + Referrer-Policy: [strict-origin-when-cross-origin] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Download-Options: [noopen] + X-Frame-Options: [SAMEORIGIN] + X-Permitted-Cross-Domain-Policies: [none] + X-Request-Id: [a3bfd49a-cb6f-4316-bc0c-f92f50577aa7] + X-Runtime: ['0.024577'] + X-XSS-Protection: [1; mode=block] + content-length: ['224'] + 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: [python-requests/2.18.4] + method: GET + uri: http://localhost:3000/api/v1/filters/20 + response: + body: {string: '{"id":20,"phrase":"anime","context":["notifications"],"whole_word":false,"expires_at":null,"irreversible":false}'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"7c314c3f632dfc88cf3900669c341d1d"] + Referrer-Policy: [strict-origin-when-cross-origin] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Download-Options: [noopen] + X-Frame-Options: [SAMEORIGIN] + X-Permitted-Cross-Domain-Policies: [none] + X-Request-Id: [7340bbb7-708b-4ceb-892c-491587b42a58] + X-Runtime: ['0.021185'] + X-XSS-Protection: [1; mode=block] + content-length: ['112'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN] + Connection: [keep-alive] + Content-Length: ['0'] + User-Agent: [python-requests/2.18.4] + method: DELETE + uri: http://localhost:3000/api/v1/filters/20 + response: + body: {string: '{}'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"65c2866b436b8d37236fba79638e73d5"] + Referrer-Policy: [strict-origin-when-cross-origin] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Download-Options: [noopen] + X-Frame-Options: [SAMEORIGIN] + X-Permitted-Cross-Domain-Policies: [none] + X-Request-Id: [b9d0bff4-9b9e-4e7f-a4d2-9b2ab26de77f] + X-Runtime: ['0.031029'] + X-XSS-Protection: [1; mode=block] + content-length: ['2'] + status: {code: 200, message: OK} +version: 1 -- cgit v1.2.3