aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-10-11 22:32:51 +0200
committerLorenz Diener <[email protected]>2019-10-11 22:32:51 +0200
commita8e49756f4524f79a8c1269b76e97c00d44051cd (patch)
treef358e9707781ece6d2ba626c88391ce48eed0db3 /tests/cassettes
parenta36fbd4bc3250bec74e6b304760f000c58d9feb2 (diff)
downloadmastodon.py-a8e49756f4524f79a8c1269b76e97c00d44051cd.tar.gz
Add a test case for conversation streaming
Diffstat (limited to 'tests/cassettes')
-rw-r--r--tests/cassettes/test_stream_direct.yaml95
1 files changed, 95 insertions, 0 deletions
diff --git a/tests/cassettes/test_stream_direct.yaml b/tests/cassettes/test_stream_direct.yaml
new file mode 100644
index 0000000..3ac9404
--- /dev/null
+++ b/tests/cassettes/test_stream_direct.yaml
@@ -0,0 +1,95 @@
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/instance/
12 response:
13 body: {string: '{"uri":"localhost","title":"Mastodon","description":"","email":"","version":"2.9.1","urls":{"streaming_api":"ws://localhost:4000"},"stats":{"user_count":3,"status_count":20,"domain_count":0},"thumbnail":"http://localhost/packs/media/images/preview-9a17d32fc48369e8ccd910a75260e67d.jpg","languages":["en"],"registrations":true,"contact_account":null}'}
14 headers:
15 Cache-Control: ['max-age=300, public']
16 Content-Type: [application/json; charset=utf-8]
17 Date: ['Fri, 11 Oct 2019 20:32:08 GMT']
18 ETag: [W/"d8eabce6cff38f5ade8c631c932a3dc3"]
19 Referrer-Policy: [strict-origin-when-cross-origin]
20 Transfer-Encoding: [chunked]
21 Vary: ['Accept-Encoding, Origin']
22 X-Content-Type-Options: [nosniff]
23 X-Download-Options: [noopen]
24 X-Frame-Options: [SAMEORIGIN]
25 X-Permitted-Cross-Domain-Policies: [none]
26 X-Request-Id: [65bee269-4e3b-44ce-b234-65b907986c10]
27 X-Runtime: ['0.033466']
28 X-XSS-Protection: [1; mode=block]
29 content-length: ['349']
30 status: {code: 200, message: OK}
31- request:
32 body: visibility=direct&status=%40mastodonpy_test+todo+funny+text+here
33 headers:
34 Accept: ['*/*']
35 Accept-Encoding: ['gzip, deflate']
36 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
37 Connection: [keep-alive]
38 Content-Length: ['64']
39 Content-Type: [application/x-www-form-urlencoded]
40 User-Agent: [python-requests/2.18.4]
41 method: POST
42 uri: http://localhost:3000/api/v1/statuses
43 response:
44 body: {string: '{"id":"102945648378590632","created_at":"2019-10-11T20:32:13.525Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"direct","language":"en","uri":"http://localhost/users/admin/statuses/102945648378590632","url":"http://localhost/@admin/102945648378590632","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"content":"\u003cp\u003e\u003cspan
45 class=\"h-card\"\u003e\u003ca href=\"http://localhost/@mastodonpy_test\" class=\"u-url
46 mention\"\u003e@\u003cspan\u003emastodonpy_test\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e
47 todo funny text here\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
48 test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":2,"following_count":1,"statuses_count":19,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"1234567890123456","username":"mastodonpy_test","url":"http://localhost/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}'}
49 headers:
50 Cache-Control: ['no-cache, no-store']
51 Content-Type: [application/json; charset=utf-8]
52 Referrer-Policy: [strict-origin-when-cross-origin]
53 Transfer-Encoding: [chunked]
54 Vary: ['Accept-Encoding, Origin']
55 X-Content-Type-Options: [nosniff]
56 X-Download-Options: [noopen]
57 X-Frame-Options: [SAMEORIGIN]
58 X-Permitted-Cross-Domain-Policies: [none]
59 X-Request-Id: [d328499a-7be2-4e47-b4ca-42a67efbb523]
60 X-Runtime: ['0.219320']
61 X-XSS-Protection: [1; mode=block]
62 content-length: ['1487']
63 status: {code: 200, message: OK}
64- request:
65 body: null
66 headers:
67 Accept: ['*/*']
68 Accept-Encoding: ['gzip, deflate']
69 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
70 Connection: [keep-alive]
71 User-Agent: [python-requests/2.18.4]
72 method: GET
73 uri: http://localhost:4000/api/v1/streaming/direct
74 response:
75 body: {string: 'event: conversation
76
77 data: {"id":"18","unread":true,"accounts":[{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"<p></p>","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":2,"following_count":1,"statuses_count":19,"emojis":[],"fields":[]}],"last_status":{"id":"102945648378590632","created_at":"2019-10-11T20:32:13.525Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"direct","language":"en","uri":"http://localhost/users/admin/statuses/102945648378590632","url":"http://localhost/@admin/102945648378590632","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"content":"<p><span
78 class=\"h-card\"><a href=\"http://localhost/@mastodonpy_test\" class=\"u-url
79 mention\">@<span>mastodonpy_test</span></a></span> todo funny text here</p>","reblog":null,"application":{"name":"Mastodon.py
80 test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"<p></p>","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":2,"following_count":1,"statuses_count":19,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[{"id":"1234567890123456","username":"mastodonpy_test","url":"http://localhost/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[],"card":null,"poll":null}}
81
82
83 :'}
84 headers:
85 Access-Control-Allow-Headers: ['Authorization, Accept, Cache-Control']
86 Access-Control-Allow-Methods: ['GET, OPTIONS']
87 Access-Control-Allow-Origin: ['*']
88 Connection: [keep-alive]
89 Content-Type: [text/event-stream]
90 Date: ['Fri, 11 Oct 2019 20:32:13 GMT']
91 Transfer-Encoding: [chunked]
92 X-Powered-By: [Express]
93 X-Request-Id: [bcbbbb42-7096-4be8-b175-8fb71c2f136f]
94 status: {code: 200, message: OK}
95version: 1
Powered by cgit v1.2.3 (git 2.41.0)