From f274e0fb5c7cf0b21db9a7df8c27dcea5637938c Mon Sep 17 00:00:00 2001 From: codl Date: Thu, 30 Nov 2017 02:24:16 +0100 Subject: add tests for mutes and blocks --- tests/cassettes/test_blocks.yaml | 27 +++++++++++++++++++++++++++ tests/cassettes/test_mutes.yaml | 27 +++++++++++++++++++++++++++ tests/test_account.py | 12 ++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 tests/cassettes/test_blocks.yaml create mode 100644 tests/cassettes/test_mutes.yaml (limited to 'tests') diff --git a/tests/cassettes/test_blocks.yaml b/tests/cassettes/test_blocks.yaml new file mode 100644 index 0000000..7f82358 --- /dev/null +++ b/tests/cassettes/test_blocks.yaml @@ -0,0 +1,27 @@ +interactions: +- 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/blocks + response: + body: {string: '[]'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"ada2bcb0a9805d2061319aaa5a76ddc2"] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Frame-Options: [SAMEORIGIN] + X-Request-Id: [8aecc6a6-3aa1-4da1-aa13-504300410e99] + X-Runtime: ['0.020203'] + X-XSS-Protection: [1; mode=block] + content-length: ['2'] + status: {code: 200, message: OK} +version: 1 diff --git a/tests/cassettes/test_mutes.yaml b/tests/cassettes/test_mutes.yaml new file mode 100644 index 0000000..4b14354 --- /dev/null +++ b/tests/cassettes/test_mutes.yaml @@ -0,0 +1,27 @@ +interactions: +- 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/mutes + response: + body: {string: '[]'} + headers: + Cache-Control: ['max-age=0, private, must-revalidate'] + Content-Type: [application/json; charset=utf-8] + ETag: [W/"ada2bcb0a9805d2061319aaa5a76ddc2"] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding, Origin'] + X-Content-Type-Options: [nosniff] + X-Frame-Options: [SAMEORIGIN] + X-Request-Id: [c06f07d7-b198-4628-a8df-e5d0e9333260] + X-Runtime: ['0.027466'] + X-XSS-Protection: [1; mode=block] + content-length: ['2'] + status: {code: 200, message: OK} +version: 1 diff --git a/tests/test_account.py b/tests/test_account.py index 3c94531..dac65ac 100644 --- a/tests/test_account.py +++ b/tests/test_account.py @@ -68,6 +68,18 @@ def test_account_mute_unmute(api): assert not relationship['muting'] +@pytest.mark.vcr() +def test_mutes(api): + mutes = api.mutes() + assert isinstance(mutes, list) + + +@pytest.mark.vcr() +def test_blocks(api): + blocks = api.blocks() + assert isinstance(blocks, list) + + @pytest.mark.vcr() def test_account_update_credentials(api): import base64 -- cgit v1.2.3