diff options
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') |