aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-04-28 21:53:01 +0200
committerLorenz Diener <[email protected]>2019-04-28 21:53:01 +0200
commit3eba3f8835f25800f37b9da18a09429b084effa0 (patch)
tree112470e2ce3e07775c8963d7373892cbb8576058 /tests
parent66524ad4df9dcff3cee3a6d6bfc198e50ce310e1 (diff)
downloadmastodon.py-3eba3f8835f25800f37b9da18a09429b084effa0.tar.gz
Add preferences endpoint
Diffstat (limited to 'tests')
-rw-r--r--tests/cassettes/test_preferences.yaml30
-rw-r--r--tests/test_account.py5
2 files changed, 34 insertions, 1 deletions
diff --git a/tests/cassettes/test_preferences.yaml b/tests/cassettes/test_preferences.yaml
new file mode 100644
index 0000000..e6e660f
--- /dev/null
+++ b/tests/cassettes/test_preferences.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/preferences
12 response:
13 body: {string: '{"posting:default:visibility":"public","posting:default:sensitive":false,"posting:default:language":null,"reading:expand:media":"default","reading:expand:spoilers":false}'}
14 headers:
15 Cache-Control: ['max-age=0, private, must-revalidate']
16 Content-Type: [application/json; charset=utf-8]
17 ETag: [W/"16e1b4c608ece78202df9c19d6a56932"]
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: [0b19cc10-64ae-4fd4-827e-0e8e1b46c673]
26 X-Runtime: ['0.032833']
27 X-XSS-Protection: [1; mode=block]
28 content-length: ['170']
29 status: {code: 200, message: OK}
30version: 1
diff --git a/tests/test_account.py b/tests/test_account.py
index cd7633d..9821c13 100644
--- a/tests/test_account.py
+++ b/tests/test_account.py
@@ -205,4 +205,7 @@ def test_account_pin_unpin(api, api2):
205 assert not relationship['endorsed'] 205 assert not relationship['endorsed']
206 assert not user["id"] in map(lambda x: x["id"], endorsed2) 206 assert not user["id"] in map(lambda x: x["id"], endorsed2)
207 207
208 208@pytest.mark.vcr()
209def test_preferences(api):
210 prefs = api.preferences()
211 assert prefs
Powered by cgit v1.2.3 (git 2.41.0)