summaryrefslogtreecommitdiff
path: root/tests/test_cli.py
diff options
context:
space:
mode:
authorSimeon Simeonov2021-12-23 14:41:14 +0100
committerSimeon Simeonov2021-12-23 14:41:14 +0100
commit4914b0c74ed669d6631897950ff1660ce91ef918 (patch)
tree5bef79607256853f41fb3bb666e1c16604a7b258 /tests/test_cli.py
Initial commit and release for Christmas with love1.0.0
Diffstat (limited to 'tests/test_cli.py')
-rw-r--r--tests/test_cli.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/test_cli.py b/tests/test_cli.py
new file mode 100644
index 0000000..1bd9be1
--- /dev/null
+++ b/tests/test_cli.py
@@ -0,0 +1,40 @@
1# etoolkit
2# Copyright (C) 2021 Simeon Simeonov
3
4# This program is free software: you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13
14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16"""Tests for the CLI (etoolkit.__main__"""
17import pytest
18
19import etoolkit
20from etoolkit.__main__ import main
21
22
23def test_help(capsys):
24 """Dummy test checking if the CLI is available at all"""
25 with pytest.raises(SystemExit) as exit_info:
26 main(['-h'])
27 assert exit_info.type == SystemExit
28 assert exit_info.value.code == 0
29 assert capsys.readouterr().out.startswith('usage: etoolkit')
30
31
32def test_version(capsys):
33 """Dummy test checking if the CLI is available at all"""
34 with pytest.raises(SystemExit) as exit_info:
35 main(['-v'])
36 assert exit_info.type == SystemExit
37 assert exit_info.value.code == 0
38 assert capsys.readouterr().out.startswith(
39 f'etoolkit {etoolkit.__version__}'
40 )