new: test: simple test for bukuserver cli

This commit is contained in:
rachmadaniHaryono 2019-02-08 19:38:24 +08:00
parent e8a2a9a96b
commit 7ff6994d9d

17
tests/test_server.py Normal file
View File

@ -0,0 +1,17 @@
from click.testing import CliRunner
import pytest
from bukuserver import server
@pytest.mark.parametrize(
'args,word',
[
('--help', 'bukuserver'),
('--version', 'Buku')
]
)
def test_cli(args, word):
runner = CliRunner()
result = runner.invoke(server.cli, [args])
assert result.exit_code == 0
assert word in result.output