imaginAIry/tests/test_safety.py

13 lines
298 B
Python
Raw Normal View History

2022-09-17 22:49:38 +00:00
from PIL import Image
from imaginairy.safety import is_nsfw
from tests import TESTS_FOLDER
def test_is_nsfw():
img = Image.open(f"{TESTS_FOLDER}/data/safety.jpg")
assert is_nsfw(img)
2022-09-17 22:49:38 +00:00
img = Image.open(f"{TESTS_FOLDER}/data/girl_with_a_pearl_earring.jpg")
assert not is_nsfw(img)