aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/index.rst5
-rw-r--r--tests/cassettes/test_app_verify_credentials.yaml30
-rw-r--r--tests/test_create_app.py6
3 files changed, 41 insertions, 0 deletions
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
811 811
812.. automethod:: Mastodon.custom_emojis 812.. automethod:: Mastodon.custom_emojis
813 813
814Reading data: Apps
815------------------
816
817.. automethod:: Mastodon.app_verify_credentials
818
814Reading data: Endorsements 819Reading data: Endorsements
815-------------------------- 820--------------------------
816 821
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 @@
1interactions:
2- request:
3 body: null
4 headers:
5 Accept: ['*/*']
6 Accept-Encoding: ['gzip, deflate']
7 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
8 Connection: [keep-alive]
9 User-Agent: [python-requests/2.18.4]
10 method: GET
11 uri: http://localhost:3000/api/v1/apps/verify_credentials
12 response:
13 body: {string: '{"name":"Mastodon.py test suite","website":null,"vapid_key":"BCryMB_mKFcSpmXE3kJ1Ri3ZFVdBLjRsX54VYhE21BMyftx8k67qWxFs2OCuQCtj0k1ILESkQhGuOKJcQnodx4g="}'}
14 headers:
15 Cache-Control: ['max-age=0, private, must-revalidate']
16 Content-Type: [application/json; charset=utf-8]
17 ETag: [W/"1c464bcb75ad0be8ac7d4c05137d27ce"]
18 Referrer-Policy: [strict-origin-when-cross-origin]
19 Transfer-Encoding: [chunked]
20 Vary: ['Accept-Encoding, Origin']
21 X-Content-Type-Options: [nosniff]
22 X-Download-Options: [noopen]
23 X-Frame-Options: [SAMEORIGIN]
24 X-Permitted-Cross-Domain-Policies: [none]
25 X-Request-Id: [0e7d0027-bc3a-4dfa-9c11-0ea7413eee5b]
26 X-Runtime: ['0.017202']
27 X-XSS-Protection: [1; mode=block]
28 content-length: ['151']
29 status: {code: 200, message: OK}
30version: 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):
40 test_create_app(mocker, website='http://example.net') 40 test_create_app(mocker, website='http://example.net')
41 kwargs = requests.post.call_args[1] 41 kwargs = requests.post.call_args[1]
42 assert kwargs['data']['website'] == 'http://example.net' 42 assert kwargs['data']['website'] == 'http://example.net'
43
44@pytest.mark.vcr()
45def test_app_verify_credentials(api):
46 app = api.app_verify_credentials()
47 assert app
48 assert app.name == 'Mastodon.py test suite'
Powered by cgit v1.2.3 (git 2.41.0)