37 lines
704 B
Python
37 lines
704 B
Python
|
from os import remove
|
||
|
from pathlib import Path
|
||
|
|
||
|
from PIL.Image import Image
|
||
|
|
||
|
from huepaper import generate
|
||
|
from huepaper.utils import save_image
|
||
|
|
||
|
|
||
|
def test_generation():
|
||
|
image = generate(
|
||
|
width=500,
|
||
|
height=500,
|
||
|
hue_max=1.0,
|
||
|
lum_min=0.3,
|
||
|
lum_max=0.6,
|
||
|
sat_min=0.8,
|
||
|
sat_max=1.0,
|
||
|
)
|
||
|
assert isinstance(image, Image)
|
||
|
|
||
|
|
||
|
def test_saving():
|
||
|
image = generate(
|
||
|
500,
|
||
|
500,
|
||
|
hue_max=1.0,
|
||
|
lum_min=0.3,
|
||
|
lum_max=0.6,
|
||
|
sat_min=0.8,
|
||
|
sat_max=1.0,
|
||
|
lines=0.0,
|
||
|
)
|
||
|
save_image(image, Path("tests/image.jpg"))
|
||
|
assert Path("tests/image.jpg").exists()
|
||
|
remove(Path("tests/image.jpg"))
|