diff options
author | halcy <halcy@ARARAGI-KUN> | 2022-11-24 00:59:48 +0200 |
---|---|---|
committer | halcy <halcy@ARARAGI-KUN> | 2022-11-24 00:59:48 +0200 |
commit | b7266db01b73348bb74dd4277053825580193477 (patch) | |
tree | a2b713e866298046f8f4fa2bf93566371ded9651 /tests/test_media.py | |
parent | 34280e604ce1caf56b3fa0b8501d82bc498b3975 (diff) | |
download | mastodon.py-b7266db01b73348bb74dd4277053825580193477.tar.gz |
Add new notification types, test for pathlib support
Diffstat (limited to 'tests/test_media.py')
-rw-r--r-- | tests/test_media.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_media.py b/tests/test_media.py index e16fb4d..9b34900 100644 --- a/tests/test_media.py +++ b/tests/test_media.py | |||
@@ -1,6 +1,7 @@ | |||
1 | import pytest | 1 | import pytest |
2 | import vcr | 2 | import vcr |
3 | import time | 3 | import time |
4 | import pathlib | ||
4 | 5 | ||
5 | @pytest.mark.vcr(match_on=['path']) | 6 | @pytest.mark.vcr(match_on=['path']) |
6 | def test_media_post_v1(api): | 7 | def test_media_post_v1(api): |
@@ -127,3 +128,10 @@ def test_media_post_file(api): | |||
127 | with open('tests/image.jpg', 'rb') as f: | 128 | with open('tests/image.jpg', 'rb') as f: |
128 | media = api.media_post(f, mime_type='image/jpeg') | 129 | media = api.media_post(f, mime_type='image/jpeg') |
129 | assert media | 130 | assert media |
131 | |||
132 | @pytest.mark.vcr(match_on=['path']) | ||
133 | def test_media_post_pathlib(api): | ||
134 | path = pathlib.Path(".") / "tests" / "image.jpg" | ||
135 | media = api.media_post(path) | ||
136 | assert media | ||
137 | \ No newline at end of file | ||