diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cassettes/test_account_notes.yaml | 123 | ||||
-rw-r--r-- | tests/test_account.py | 27 |
2 files changed, 128 insertions, 22 deletions
diff --git a/tests/cassettes/test_account_notes.yaml b/tests/cassettes/test_account_notes.yaml new file mode 100644 index 0000000..275514c --- /dev/null +++ b/tests/cassettes/test_account_notes.yaml | |||
@@ -0,0 +1,123 @@ | |||
1 | interactions: | ||
2 | - request: | ||
3 | body: null | ||
4 | headers: | ||
5 | Accept: | ||
6 | - '*/*' | ||
7 | Accept-Encoding: | ||
8 | - gzip, deflate | ||
9 | Authorization: | ||
10 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2 | ||
11 | Connection: | ||
12 | - keep-alive | ||
13 | User-Agent: | ||
14 | - tests/v311 | ||
15 | method: GET | ||
16 | uri: http://localhost:3000/api/v1/accounts/verify_credentials | ||
17 | response: | ||
18 | body: | ||
19 | string: '{"id":"109336199753389764","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"discoverable":null,"group":false,"created_at":"2022-11-13T00:00:00.000Z","note":"","url":"http://localhost:3000/@admin","avatar":"http://localhost:3000/avatars/original/missing.png","avatar_static":"http://localhost:3000/avatars/original/missing.png","header":"http://localhost:3000/headers/original/missing.png","header_static":"http://localhost:3000/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"noindex":false,"source":{"privacy":"public","sensitive":false,"language":null,"note":"","fields":[],"follow_requests_count":0},"emojis":[],"fields":[],"role":{"id":"3","name":"Owner","permissions":"1048575","color":"","highlighted":true}}' | ||
20 | headers: | ||
21 | Cache-Control: | ||
22 | - no-store | ||
23 | Content-Security-Policy: | ||
24 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
25 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
26 | style-src ''self'' http://localhost:3000 ''nonce-TRItETB4W72vy3k5XQZRAA==''; | ||
27 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
28 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
29 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
30 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
31 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
32 | worker-src ''self'' blob: http://localhost:3000' | ||
33 | Content-Type: | ||
34 | - application/json; charset=utf-8 | ||
35 | ETag: | ||
36 | - W/"a576b865af5fce00b4019a62d9c55f75" | ||
37 | Referrer-Policy: | ||
38 | - strict-origin-when-cross-origin | ||
39 | Transfer-Encoding: | ||
40 | - chunked | ||
41 | Vary: | ||
42 | - Accept, Origin | ||
43 | X-Content-Type-Options: | ||
44 | - nosniff | ||
45 | X-Download-Options: | ||
46 | - noopen | ||
47 | X-Frame-Options: | ||
48 | - SAMEORIGIN | ||
49 | X-Permitted-Cross-Domain-Policies: | ||
50 | - none | ||
51 | X-Request-Id: | ||
52 | - 53684e14-3054-47ec-aa8f-7450b0c38056 | ||
53 | X-Runtime: | ||
54 | - '0.025567' | ||
55 | X-XSS-Protection: | ||
56 | - 1; mode=block | ||
57 | status: | ||
58 | code: 200 | ||
59 | message: OK | ||
60 | - request: | ||
61 | body: comment=top+ebayer+gerne+wieder | ||
62 | headers: | ||
63 | Accept: | ||
64 | - '*/*' | ||
65 | Accept-Encoding: | ||
66 | - gzip, deflate | ||
67 | Authorization: | ||
68 | - Bearer __MASTODON_PY_TEST_ACCESS_TOKEN | ||
69 | Connection: | ||
70 | - keep-alive | ||
71 | Content-Length: | ||
72 | - '31' | ||
73 | Content-Type: | ||
74 | - application/x-www-form-urlencoded | ||
75 | User-Agent: | ||
76 | - tests/v311 | ||
77 | method: POST | ||
78 | uri: http://localhost:3000/api/v1/accounts/109336199753389764/note | ||
79 | response: | ||
80 | body: | ||
81 | string: '{"id":"109336199753389764","following":false,"showing_reblogs":false,"notifying":false,"languages":null,"followed_by":false,"blocking":false,"blocked_by":false,"muting":false,"muting_notifications":false,"requested":false,"domain_blocking":false,"endorsed":false,"note":"top | ||
82 | ebayer gerne wieder"}' | ||
83 | headers: | ||
84 | Cache-Control: | ||
85 | - no-store | ||
86 | Content-Security-Policy: | ||
87 | - 'base-uri ''none''; default-src ''none''; frame-ancestors ''none''; font-src | ||
88 | ''self'' http://localhost:3000; img-src ''self'' https: data: blob: http://localhost:3000; | ||
89 | style-src ''self'' http://localhost:3000 ''nonce-3t+BKMJ4b8EcyKFsQ7MZOg==''; | ||
90 | media-src ''self'' https: data: http://localhost:3000; frame-src ''self'' | ||
91 | https:; manifest-src ''self'' http://localhost:3000; connect-src ''self'' | ||
92 | data: blob: http://localhost:3000 http://localhost:3000 ws://localhost:4000 | ||
93 | ws://localhost:3035 http://localhost:3035; script-src ''self'' ''unsafe-inline'' | ||
94 | ''unsafe-eval'' http://localhost:3000; child-src ''self'' blob: http://localhost:3000; | ||
95 | worker-src ''self'' blob: http://localhost:3000' | ||
96 | Content-Type: | ||
97 | - application/json; charset=utf-8 | ||
98 | ETag: | ||
99 | - W/"c3ead4efc220cb74679970c3bb3bd0cf" | ||
100 | Referrer-Policy: | ||
101 | - strict-origin-when-cross-origin | ||
102 | Transfer-Encoding: | ||
103 | - chunked | ||
104 | Vary: | ||
105 | - Accept, Origin | ||
106 | X-Content-Type-Options: | ||
107 | - nosniff | ||
108 | X-Download-Options: | ||
109 | - noopen | ||
110 | X-Frame-Options: | ||
111 | - SAMEORIGIN | ||
112 | X-Permitted-Cross-Domain-Policies: | ||
113 | - none | ||
114 | X-Request-Id: | ||
115 | - 91546468-a591-49ad-ac52-f2c5ab510161 | ||
116 | X-Runtime: | ||
117 | - '0.037352' | ||
118 | X-XSS-Protection: | ||
119 | - 1; mode=block | ||
120 | status: | ||
121 | code: 200 | ||
122 | message: OK | ||
123 | version: 1 | ||
diff --git a/tests/test_account.py b/tests/test_account.py index 6584dbc..ef48d4e 100644 --- a/tests/test_account.py +++ b/tests/test_account.py | |||
@@ -233,26 +233,9 @@ def test_suggested_tags(api): | |||
233 | @pytest.mark.vcr() | 233 | @pytest.mark.vcr() |
234 | def test_featured_tags(api): | 234 | def test_featured_tags(api): |
235 | featured_tag = api.featured_tag_create("ringtones") | 235 | featured_tag = api.featured_tag_create("ringtones") |
236 | """try: | ||
237 | status = api.status_post("cool free #ringtones") | ||
238 | time.sleep(2) | ||
239 | 236 | ||
240 | featured_tag = api.featured_tag_create("ringtones") | 237 | @pytest.mark.vcr() |
241 | assert featured_tag | 238 | def test_account_notes(api, api2): |
242 | 239 | relationship = api.account_note_set(api2.account_verify_credentials(), "top ebayer gerne wieder") | |
243 | tag_list = api.featured_tags() | 240 | assert relationship |
244 | assert featured_tag.name in list(map(lambda x: x.name, tag_list)) | 241 | assert relationship.note == "top ebayer gerne wieder" |
245 | |||
246 | api.featured_tag_delete(featured_tag) | ||
247 | tag_list = api.featured_tags() | ||
248 | assert not featured_tag.name in list(map(lambda x: x.name, tag_list)) | ||
249 | finally: | ||
250 | api.status_delete(status)""" | ||
251 | |||
252 | |||
253 | |||
254 | |||
255 | |||
256 | |||
257 | |||
258 | |||