test: add smoke test for edit command

This commit is contained in:
Bryce 2023-02-18 15:40:04 -08:00 committed by Bryce Drennan
parent 1563e0b871
commit 7b684b6e5c

View File

@ -1,7 +1,7 @@
import pytest
from click.testing import CliRunner
from imaginairy.cmds import imagine_cmd
from imaginairy.cmds import edit_image, imagine_cmd
from imaginairy.utils import get_device
from tests import TESTS_FOLDER
@ -22,3 +22,19 @@ def test_imagine_cmd():
],
)
assert result.exit_code == 0
@pytest.mark.skipif(get_device() == "cpu", reason="Too slow to run on CPU")
def test_edit_cmd():
runner = CliRunner()
result = runner.invoke(
edit_image,
[
f"{TESTS_FOLDER}/data/dog.jpg",
"--steps",
"1",
"-p",
"turn the dog into a cat",
],
)
assert result.exit_code == 0