diff --git a/docs/index.rst b/docs/index.rst index 55335b6..3cf236c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -811,6 +811,11 @@ Reading data: Emoji .. automethod:: Mastodon.custom_emojis +Reading data: Apps +------------------ + +.. automethod:: Mastodon.app_verify_credentials + Reading data: Endorsements -------------------------- diff --git a/tests/cassettes/test_app_verify_credentials.yaml b/tests/cassettes/test_app_verify_credentials.yaml new file mode 100644 index 0000000..565dd6d --- /dev/null +++ b/tests/cassettes/test_app_verify_credentials.yaml @@ -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 diff --git a/tests/test_create_app.py b/tests/test_create_app.py index 8745b47..67318e9 100644 --- a/tests/test_create_app.py +++ b/tests/test_create_app.py @@ -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'