imaginAIry/tests/test_safety.py
Bryce eaad0a15e4 ci: add automated testing/linting
- fix bugs
- disable some tests from running in CPU only mode since github actions can't handle it
2022-09-24 23:31:03 -07:00

14 lines
299 B
Python

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)
img = Image.open(f"{TESTS_FOLDER}/data/girl_with_a_pearl_earring.jpg")
assert not is_nsfw(img)