habitmove/tests/test_cli.py

16 lines
291 B
Python
Raw Permalink Normal View History

2021-12-06 22:20:18 +00:00
import click.testing
2021-12-06 22:36:24 +00:00
import pytest
2021-12-06 22:20:18 +00:00
from habitmove import cli
2021-12-06 22:36:24 +00:00
@pytest.fixture
def runner():
return click.testing.CliRunner()
def test_cli_fails_without_file(runner):
2021-12-06 22:20:18 +00:00
result = runner.invoke(cli.main)
assert result.exit_code == 2
assert "Missing argument" in result.output