aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2018-05-06 01:41:50 +0200
committerLorenz Diener <[email protected]>2018-05-06 01:41:50 +0200
commitde29029037e2b94474b60971ce3cd006f3f7b419 (patch)
treee0c89e3cd857d795151557f173a283388f1ea7f0
parenta15d28d9d60128fd5551f05eccd8999b46f70f5e (diff)
downloadmastodon.py-de29029037e2b94474b60971ce3cd006f3f7b419.tar.gz
Add casette for test_stream_user
-rw-r--r--tests/cassettes/test_stream_user.yaml167
1 files changed, 167 insertions, 0 deletions
diff --git a/tests/cassettes/test_stream_user.yaml b/tests/cassettes/test_stream_user.yaml
new file mode 100644
index 0000000..eb378d2
--- /dev/null
+++ b/tests/cassettes/test_stream_user.yaml
@@ -0,0 +1,167 @@
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.9.1]
10 method: GET
11 uri: http://localhost:3000/api/v1/instance/
12 response:
13 body: {string: '{"uri":"localhost:3000","title":"Mastodon","description":"","email":"","version":"2.3.3","urls":{"streaming_api":"ws://localhost:4000"},"stats":{"user_count":2,"status_count":163,"domain_count":0},"thumbnail":"http://localhost:3000/packs/preview.jpg","languages":["en"],"contact_account":null}'}
14 headers:
15 Cache-Control: ['max-age=0, private, must-revalidate']
16 Content-Type: [application/json; charset=utf-8]
17 ETag: [W/"2cc4eba842d06668a5e9f36dd5e75e0b"]
18 Transfer-Encoding: [chunked]
19 Vary: ['Accept-Encoding, Origin']
20 X-Content-Type-Options: [nosniff]
21 X-Frame-Options: [SAMEORIGIN]
22 X-Request-Id: [58fc9460-3f90-4bdc-bfae-97b4792cdf72]
23 X-Runtime: ['0.030782']
24 X-XSS-Protection: [1; mode=block]
25 content-length: ['293']
26 status: {code: 200, message: OK}
27- request:
28 body: status=only+real+cars+respond.
29 headers:
30 Accept: ['*/*']
31 Accept-Encoding: ['gzip, deflate']
32 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
33 Connection: [keep-alive]
34 Content-Length: ['30']
35 Content-Type: [application/x-www-form-urlencoded]
36 User-Agent: [python-requests/2.9.1]
37 method: POST
38 uri: http://localhost:3000/api/v1/statuses
39 response:
40 body: {string: '{"id":"99979315699876567","created_at":"2018-05-05T23:34:48.888Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/mastodonpy_test/statuses/99979315699876567","content":"\u003cp\u003eonly
41 real cars respond.\u003c/p\u003e","url":"http://localhost:3000/@mastodonpy_test/99979315699876567","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py
42 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"John
43 Lennon","locked":true,"created_at":"2018-04-18T20:04:06.511Z","note":"\u003cp\u003eI
44 walk funny\u003c/p\u003e","url":"http://localhost:3000/@mastodonpy_test","avatar":"http://localhost:3000/system/accounts/avatars/123/456/789/012/345/original/mastodonpyupload_.jpe","avatar_static":"http://localhost:3000/system/accounts/avatars/123/456/789/012/345/original/mastodonpyupload_.jpe","header":"http://localhost:3000/system/accounts/headers/123/456/789/012/345/original/mastodonpyupload_.jpe","header_static":"http://localhost:3000/system/accounts/headers/123/456/789/012/345/original/mastodonpyupload_.jpe","followers_count":0,"following_count":0,"statuses_count":126},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'}
45 headers:
46 Cache-Control: ['max-age=0, private, must-revalidate']
47 Content-Type: [application/json; charset=utf-8]
48 ETag: [W/"3c8a52db795c6a852e9e7a21e7d912f4"]
49 Transfer-Encoding: [chunked]
50 Vary: ['Accept-Encoding, Origin']
51 X-Content-Type-Options: [nosniff]
52 X-Frame-Options: [SAMEORIGIN]
53 X-Request-Id: [1f6725bf-2550-450f-bba5-d3967b33b7dc]
54 X-Runtime: ['0.147682']
55 X-XSS-Protection: [1; mode=block]
56 content-length: ['1416']
57 status: {code: 200, message: OK}
58- request:
59 body: status=%40mastodonpy_test+beep+beep+I%27m+a+jeep
60 headers:
61 Accept: ['*/*']
62 Accept-Encoding: ['gzip, deflate']
63 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
64 Connection: [keep-alive]
65 Content-Length: ['48']
66 Content-Type: [application/x-www-form-urlencoded]
67 User-Agent: [python-requests/2.9.1]
68 method: POST
69 uri: http://localhost:3000/api/v1/statuses
70 response:
71 body: {string: '{"id":"99979315714058991","created_at":"2018-05-05T23:34:49.170Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99979315714058991","content":"\u003cp\u003e\u003cspan
72 class=\"h-card\"\u003e\u003ca href=\"http://localhost:3000/@mastodonpy_test\"
73 class=\"u-url mention\"\u003e@\u003cspan\u003emastodonpy_test\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e
74 beep beep I\u0026apos;m a jeep\u003c/p\u003e","url":"http://localhost:3000/@admin/99979315714058991","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py
75 test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"created_at":"2018-04-17T21:40:55.626Z","note":"\u003cp\u003e\u003c/p\u003e","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":39},"media_attachments":[],"mentions":[{"id":"1234567890123456","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[]}'}
76 headers:
77 Cache-Control: ['max-age=0, private, must-revalidate']
78 Content-Type: [application/json; charset=utf-8]
79 ETag: [W/"9852f6d00e1e9011caad26f718aa286a"]
80 Transfer-Encoding: [chunked]
81 Vary: ['Accept-Encoding, Origin']
82 X-Content-Type-Options: [nosniff]
83 X-Frame-Options: [SAMEORIGIN]
84 X-Request-Id: [703ca6b3-f3c1-4157-96d0-34c07140c177]
85 X-Runtime: ['0.348615']
86 X-XSS-Protection: [1; mode=block]
87 content-length: ['1476']
88 status: {code: 200, message: OK}
89- request:
90 body: status=on+the+internet%2C+nobody+knows+you%27re+a+plane
91 headers:
92 Accept: ['*/*']
93 Accept-Encoding: ['gzip, deflate']
94 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
95 Connection: [keep-alive]
96 Content-Length: ['55']
97 Content-Type: [application/x-www-form-urlencoded]
98 User-Agent: [python-requests/2.9.1]
99 method: POST
100 uri: http://localhost:3000/api/v1/statuses
101 response:
102 body: {string: '{"id":"99979315736933684","created_at":"2018-05-05T23:34:49.488Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99979315736933684","content":"\u003cp\u003eon
103 the internet, nobody knows you\u0026apos;re a plane\u003c/p\u003e","url":"http://localhost:3000/@admin/99979315736933684","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py
104 test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"created_at":"2018-04-17T21:40:55.626Z","note":"\u003cp\u003e\u003c/p\u003e","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":40},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}'}
105 headers:
106 Cache-Control: ['max-age=0, private, must-revalidate']
107 Content-Type: [application/json; charset=utf-8]
108 ETag: [W/"28991dfce9a4da45ed0bc7c886a05ac7"]
109 Transfer-Encoding: [chunked]
110 Vary: ['Accept-Encoding, Origin']
111 X-Content-Type-Options: [nosniff]
112 X-Frame-Options: [SAMEORIGIN]
113 X-Request-Id: [1bc22f75-7163-44f7-9e7f-696b7da28fc8]
114 X-Runtime: ['0.279044']
115 X-XSS-Protection: [1; mode=block]
116 content-length: ['1175']
117 status: {code: 200, message: OK}
118- request:
119 body: null
120 headers:
121 Accept: ['*/*']
122 Accept-Encoding: ['gzip, deflate']
123 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
124 Connection: [keep-alive]
125 User-Agent: [python-requests/2.9.1]
126 method: GET
127 uri: http://localhost:4000/api/v1/streaming/user
128 response:
129 body: {string: 'event: update
130
131 data: {"id":"99979315699876567","created_at":"2018-05-05T23:34:48.888Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/mastodonpy_test/statuses/99979315699876567","content":"<p>only
132 real cars respond.</p>","url":"http://localhost:3000/@mastodonpy_test/99979315699876567","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py
133 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"John
134 Lennon","locked":true,"created_at":"2018-04-18T20:04:06.511Z","note":"<p>I
135 walk funny</p>","url":"http://localhost:3000/@mastodonpy_test","avatar":"http://localhost:3000/system/accounts/avatars/123/456/789/012/345/original/mastodonpyupload_.jpe","avatar_static":"http://localhost:3000/system/accounts/avatars/123/456/789/012/345/original/mastodonpyupload_.jpe","header":"http://localhost:3000/system/accounts/headers/123/456/789/012/345/original/mastodonpyupload_.jpe","header_static":"http://localhost:3000/system/accounts/headers/123/456/789/012/345/original/mastodonpyupload_.jpe","followers_count":0,"following_count":0,"statuses_count":126},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}
136
137
138 event: update
139
140 data: {"id":"99979315699876567","created_at":"2018-05-05T23:34:48.888Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/mastodonpy_test/statuses/99979315699876567","content":"<p>only
141 real cars respond.</p>","url":"http://localhost:3000/@mastodonpy_test/99979315699876567","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"reblog":null,"application":{"name":"Mastodon.py
142 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"John
143 Lennon","locked":true,"created_at":"2018-04-18T20:04:06.511Z","note":"<p>I
144 walk funny</p>","url":"http://localhost:3000/@mastodonpy_test","avatar":"http://localhost:3000/system/accounts/avatars/123/456/789/012/345/original/mastodonpyupload_.jpe","avatar_static":"http://localhost:3000/system/accounts/avatars/123/456/789/012/345/original/mastodonpyupload_.jpe","header":"http://localhost:3000/system/accounts/headers/123/456/789/012/345/original/mastodonpyupload_.jpe","header_static":"http://localhost:3000/system/accounts/headers/123/456/789/012/345/original/mastodonpyupload_.jpe","followers_count":0,"following_count":0,"statuses_count":126},"media_attachments":[],"mentions":[],"tags":[],"emojis":[]}
145
146
147 event: notification
148
149 data: {"id":"98","type":"mention","created_at":"2018-05-05T23:34:49.249Z","account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"created_at":"2018-04-17T21:40:55.626Z","note":"<p></p>","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":39},"status":{"id":"99979315714058991","created_at":"2018-05-05T23:34:49.170Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"en","uri":"http://localhost:3000/users/admin/statuses/99979315714058991","content":"<p><span
150 class=\"h-card\"><a href=\"http://localhost:3000/@mastodonpy_test\" class=\"u-url
151 mention\">@<span>mastodonpy_test</span></a></span> beep beep I&apos;m a jeep</p>","url":"http://localhost:3000/@admin/99979315714058991","reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"reblog":null,"application":{"name":"Mastodon.py
152 test suite","website":null},"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"created_at":"2018-04-17T21:40:55.626Z","note":"<p></p>","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":39},"media_attachments":[],"mentions":[{"id":"1234567890123456","username":"mastodonpy_test","url":"http://localhost:3000/@mastodonpy_test","acct":"mastodonpy_test"}],"tags":[],"emojis":[]}}
153
154
155'}
156 headers:
157 Access-Control-Allow-Headers: ['Authorization, Accept, Cache-Control']
158 Access-Control-Allow-Methods: ['GET, OPTIONS']
159 Access-Control-Allow-Origin: ['*']
160 Connection: [keep-alive]
161 Content-Type: [text/event-stream]
162 Date: ['Sat, 05 May 2018 23:34:49 GMT']
163 Transfer-Encoding: [chunked]
164 X-Powered-By: [Express]
165 X-Request-Id: [6ad697a2-e602-43fd-84b6-7676c3355d8f]
166 status: {code: 200, message: OK}
167version: 1
Powered by cgit v1.2.3 (git 2.41.0)