From 7ff6994d9dfde44b5c13f2628ac5be92233a032c Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Fri, 8 Feb 2019 19:38:24 +0800 Subject: [PATCH] new: test: simple test for bukuserver cli --- tests/test_server.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/test_server.py diff --git a/tests/test_server.py b/tests/test_server.py new file mode 100644 index 0000000..88f1dc1 --- /dev/null +++ b/tests/test_server.py @@ -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