Made a module out of this project
This commit is contained in:
36
tests/test_500x500.py
Normal file
36
tests/test_500x500.py
Normal file
@@ -0,0 +1,36 @@
|
||||
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"))
|
Reference in New Issue
Block a user