Total Complexity | 3 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import pytest |
||
2 | from typer.testing import CliRunner |
||
3 | |||
4 | from mandos.cli import Commands, What, cli |
||
5 | |||
6 | from . import get_test_resource |
||
7 | |||
8 | |||
9 | class TestCli: |
||
10 | def test_help(self): |
||
11 | runner = CliRunner() |
||
12 | result = runner.invoke(cli, ["--help"]) |
||
13 | assert result.exit_code == 0 |
||
14 | assert "Usage" in result.stdout |
||
15 | |||
16 | def test_search(self): |
||
17 | runner = CliRunner() |
||
18 | path = get_test_resource("inchis.txt") |
||
19 | result = runner.invoke(cli, ["search", "atc", str(path)]) |
||
20 | if result.exception is not None: |
||
21 | raise result.exception |
||
22 | assert result.stdout == "" |
||
23 | |||
24 | |||
25 | if __name__ == "__main__": |
||
26 | pytest.main() |
||
27 |