From 429132e9566f33f7f076705b65636dc517060b59 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sun, 28 Apr 2019 00:14:30 +0200 Subject: Test and document app_verify_credentials --- tests/cassettes/test_app_verify_credentials.yaml | 30 ++++++++++++++++++++++++ tests/test_create_app.py | 6 +++++ 2 files changed, 36 insertions(+) create mode 100644 tests/cassettes/test_app_verify_credentials.yaml (limited to 'tests') 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' -- cgit v1.2.3