aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-04-28 00:14:30 +0200
committerLorenz Diener <[email protected]>2019-04-28 00:14:30 +0200
commit429132e9566f33f7f076705b65636dc517060b59 (patch)
tree95f7876e978148dd95326e57a9f2fadeff617c3b /tests
parent67824478afe41aabb8802efd632fb653dd6e834a (diff)
downloadmastodon.py-429132e9566f33f7f076705b65636dc517060b59.tar.gz
Test and document app_verify_credentials
Diffstat (limited to 'tests')
-rw-r--r--tests/cassettes/test_app_verify_credentials.yaml30
-rw-r--r--tests/test_create_app.py6
2 files changed, 36 insertions, 0 deletions
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)