Skip to content

Commit 77dca0b

Browse files
committed
add sample tests
1 parent f4ebc05 commit 77dca0b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dependencies = [
2121
"discord.py>=2.0.0",
2222
"questionary>=1.0.0",
2323
"keyring>=23.0.0",
24+
"pytest"
2425
]
2526

2627
[project.scripts]

tests/test_cli.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import pytest
2+
from click.testing import CliRunner
3+
from zuffer.cli import main
4+
5+
def test_cli_invokes_without_error():
6+
runner = CliRunner()
7+
result = runner.invoke(main)
8+
assert result.exit_code == 0
9+
10+
def test_cli_help_works():
11+
runner = CliRunner()
12+
result = runner.invoke(main, ['--help'])
13+
assert result.exit_code == 0
14+
assert "Usage: main [OPTIONS] COMMAND [ARGS]..." in result.output
15+
assert "Zuffer CLI - Discord Server Management Tool" in result.output

0 commit comments

Comments
 (0)