add tests for mutes and blocks

This commit is contained in:
codl 2017-11-30 02:24:16 +01:00
pare 7389a8888d
commit f274e0fb5c
No se encontró ninguna clave conocida en la base de datos para esta firma
ID de clave GPG: 6CD7C8891ED1233A
S'han modificat 3 arxius amb 66 adicions i 0 eliminacions

Veure arxiu

@ -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

Veure arxiu

@ -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

Veure arxiu

@ -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