Add previously forgotten test
This commit is contained in:
pare
721fe308ac
commit
cc2089795f
S'han modificat 1 arxius amb 21 adicions i 0 eliminacions
21
tests/test_blurhash.py
Normal file
21
tests/test_blurhash.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
def test_blurhash_decode(api):
|
||||||
|
fake_media_dict = {
|
||||||
|
'width': 320,
|
||||||
|
'height': 240,
|
||||||
|
'blurhash': '=~NdOWof1PbIPUXSvgbI$f'
|
||||||
|
}
|
||||||
|
decoded_image = api.decode_blurhash(fake_media_dict)
|
||||||
|
assert len(decoded_image) == 9 * 16
|
||||||
|
assert len(decoded_image[0]) == 16
|
||||||
|
|
||||||
|
decoded_image_2 = api.decode_blurhash(
|
||||||
|
fake_media_dict,
|
||||||
|
out_size = (fake_media_dict["width"], fake_media_dict["height"]),
|
||||||
|
size_per_component = False,
|
||||||
|
return_linear = False
|
||||||
|
)
|
||||||
|
assert len(decoded_image_2) == 240
|
||||||
|
assert len(decoded_image_2[0]) == 320
|
||||||
|
|
Loading…
Referencia en una nova incidència