diff options
author | Lorenz Diener <[email protected]> | 2018-06-05 22:52:18 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2018-06-05 22:52:18 +0200 |
commit | 01e52ccd8fe9dda667e0a7cc1a872a0437a10c8e (patch) | |
tree | 4e09dc579d8bdad23cda0a19a45937a8b19f48c4 /tests/test_media.py | |
parent | 18c6b3b90ff8bd607df18af86d092ac1205ffbf7 (diff) | |
download | mastodon.py-01e52ccd8fe9dda667e0a7cc1a872a0437a10c8e.tar.gz |
Add push tests
Diffstat (limited to 'tests/test_media.py')
-rw-r--r-- | tests/test_media.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_media.py b/tests/test_media.py index 6e7bf73..f2c3b2f 100644 --- a/tests/test_media.py +++ b/tests/test_media.py | |||
@@ -28,6 +28,25 @@ def test_media_post(api, sensitive): | |||
28 | api.status_delete(status['id']) | 28 | api.status_delete(status['id']) |
29 | 29 | ||
30 | @pytest.mark.vcr(match_on=['path']) | 30 | @pytest.mark.vcr(match_on=['path']) |
31 | def test_media_update(api): | ||
32 | media = api.media_post( | ||
33 | 'tests/image.jpg', | ||
34 | description="John Lennon doing a funny walk", | ||
35 | focus=(-0.5, 0.3)) | ||
36 | |||
37 | assert media | ||
38 | |||
39 | media_up = api.media_update( | ||
40 | media, | ||
41 | description="John Lennon doing a cool walk", | ||
42 | focus=(0.69, 0.69)) | ||
43 | |||
44 | assert media_up | ||
45 | assert media_up['description'] == "John Lennon doing a cool walk" | ||
46 | assert media_up['meta']['focus']['x'] == 0.69 | ||
47 | assert media_up['meta']['focus']['y'] == 0.69 | ||
48 | |||
49 | @pytest.mark.vcr(match_on=['path']) | ||
31 | def test_media_post_file(api): | 50 | def test_media_post_file(api): |
32 | with open('tests/image.jpg', 'rb') as f: | 51 | with open('tests/image.jpg', 'rb') as f: |
33 | media = api.media_post(f, mime_type='image/jpeg') | 52 | media = api.media_post(f, mime_type='image/jpeg') |