-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathtest_tiatoolbox.py
31 lines (23 loc) · 1.01 KB
/
test_tiatoolbox.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
"""Pytests for `tiatoolbox` package."""
from __future__ import annotations
from click.testing import CliRunner
from tiatoolbox import __version__, cli
# -------------------------------------------------------------------------------------
# Command Line Interface
# -------------------------------------------------------------------------------------
def test_command_line_help_interface() -> None:
"""Test the CLI help."""
runner = CliRunner()
result = runner.invoke(cli.main)
assert result.exit_code == 0
help_result = runner.invoke(cli.main, ["--help"])
assert help_result.exit_code == 0
assert "Computational pathology toolbox by TIA Centre." in help_result.output
def test_command_line_version() -> None:
"""Test for version check."""
runner = CliRunner()
version_result = runner.invoke(cli.main, ["-v"])
assert __version__ in version_result.output
version_result = runner.invoke(cli.main, ["--version"])
assert __version__ in version_result.output