Document and test focus

This commit is contained in:
Lorenz Diener 2018-06-04 21:20:43 +02:00
pare 362767f911
commit 465981ea9a
S'han modificat 5 arxius amb 2880 adicions i 2868 eliminacions

Veure arxiu

@ -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:

La diferencia del archivo ha sido suprimido porque es demasiado grande Cargar Diff

La diferencia del archivo ha sido suprimido porque es demasiado grande Cargar Diff

La diferencia del archivo ha sido suprimido porque es demasiado grande Cargar Diff

Veure arxiu

@ -5,7 +5,8 @@ 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
@ -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'])