2022-09-22 05:38:44 +00:00
|
|
|
import pytest
|
2022-09-17 22:49:38 +00:00
|
|
|
from click.testing import CliRunner
|
|
|
|
|
|
|
|
from imaginairy.cmds import imagine_cmd
|
2022-09-22 05:38:44 +00:00
|
|
|
from imaginairy.utils import get_device
|
2022-09-17 22:49:38 +00:00
|
|
|
from tests import TESTS_FOLDER
|
|
|
|
|
|
|
|
|
2022-09-22 05:38:44 +00:00
|
|
|
@pytest.mark.skipif(get_device() == "cpu", reason="Too slow to run on CPU")
|
2022-09-17 22:49:38 +00:00
|
|
|
def test_imagine_cmd():
|
|
|
|
runner = CliRunner()
|
|
|
|
result = runner.invoke(
|
|
|
|
imagine_cmd,
|
2022-09-28 00:04:16 +00:00
|
|
|
[
|
|
|
|
"gold coins",
|
|
|
|
"--steps",
|
|
|
|
"25",
|
|
|
|
"--outdir",
|
|
|
|
f"{TESTS_FOLDER}/test_output",
|
|
|
|
"--seed",
|
|
|
|
"703425280",
|
|
|
|
],
|
2022-09-17 22:49:38 +00:00
|
|
|
)
|
|
|
|
assert result.exit_code == 0
|