kopia lustrzana https://github.com/halcy/Mastodon.py
Document and test focus
rodzic
362767f911
commit
465981ea9a
|
@ -409,6 +409,7 @@ Media dicts
|
|||
# May additionally contain an "fps" field giving a videos frames per second (possibly
|
||||
# rounded), and a "length" field giving a videos length in a human-readable format.
|
||||
# Note that a video may have an image as preview.
|
||||
# May also contain a 'focus' dict.
|
||||
}
|
||||
|
||||
# Metadata dicts (image) - all fields are optional:
|
||||
|
@ -429,6 +430,12 @@ Media dicts
|
|||
'bitrate': # Average bit-rate of the video in bytes per second
|
||||
}
|
||||
|
||||
# Focus Metadata dict:
|
||||
{
|
||||
'x': Focus point x coordinate (between -1 and 1)
|
||||
'y': Focus point x coordinate (between -1 and 1)
|
||||
}
|
||||
|
||||
Card dicts
|
||||
~~~~~~~~~~
|
||||
.. _card dict:
|
||||
|
|
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
|
@ -5,8 +5,9 @@ import pytest
|
|||
def test_media_post(api, sensitive):
|
||||
media = api.media_post(
|
||||
'tests/image.jpg',
|
||||
description="John Lennon doing a funny walk")
|
||||
|
||||
description="John Lennon doing a funny walk",
|
||||
focus=(-0.5, 0.3))
|
||||
|
||||
assert media
|
||||
|
||||
status = api.status_post(
|
||||
|
@ -21,6 +22,8 @@ def test_media_post(api, sensitive):
|
|||
assert status['sensitive'] == sensitive
|
||||
assert status['media_attachments']
|
||||
assert status['media_attachments'][0]['description']
|
||||
assert status['media_attachments'][0]['meta']['focus']['x'] == -0.5
|
||||
assert status['media_attachments'][0]['meta']['focus']['y'] == 0.3
|
||||
finally:
|
||||
api.status_delete(status['id'])
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue