Test and document app_verify_credentials

This commit is contained in:
Lorenz Diener 2019-04-28 00:14:30 +02:00
pare 67824478af
commit 429132e956
S'han modificat 3 arxius amb 41 adicions i 0 eliminacions

Veure arxiu

@ -811,6 +811,11 @@ Reading data: Emoji
.. automethod:: Mastodon.custom_emojis
Reading data: Apps
------------------
.. automethod:: Mastodon.app_verify_credentials
Reading data: Endorsements
--------------------------

Veure arxiu

@ -0,0 +1,30 @@
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/apps/verify_credentials
response:
body: {string: '{"name":"Mastodon.py test suite","website":null,"vapid_key":"BCryMB_mKFcSpmXE3kJ1Ri3ZFVdBLjRsX54VYhE21BMyftx8k67qWxFs2OCuQCtj0k1ILESkQhGuOKJcQnodx4g="}'}
headers:
Cache-Control: ['max-age=0, private, must-revalidate']
Content-Type: [application/json; charset=utf-8]
ETag: [W/"1c464bcb75ad0be8ac7d4c05137d27ce"]
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: [0e7d0027-bc3a-4dfa-9c11-0ea7413eee5b]
X-Runtime: ['0.017202']
X-XSS-Protection: [1; mode=block]
content-length: ['151']
status: {code: 200, message: OK}
version: 1

Veure arxiu

@ -40,3 +40,9 @@ def test_create_app_website(mocker):
test_create_app(mocker, website='http://example.net')
kwargs = requests.post.call_args[1]
assert kwargs['data']['website'] == 'http://example.net'
@pytest.mark.vcr()
def test_app_verify_credentials(api):
app = api.app_verify_credentials()
assert app
assert app.name == 'Mastodon.py test suite'