Total Complexity | 2 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | #!/usr/bin/env python |
||
2 | |||
3 | """Tests for `trending_homebrew` package.""" |
||
4 | |||
5 | import pytest |
||
6 | |||
7 | from click.testing import CliRunner |
||
8 | |||
9 | from trending_homebrew import trending_homebrew |
||
10 | from trending_homebrew import longest |
||
11 | from trending_homebrew import cli |
||
12 | |||
13 | def test_command_line_interface(): |
||
14 | """Test the CLI.""" |
||
15 | runner = CliRunner() |
||
16 | result = runner.invoke(cli.main) |
||
17 | assert result.output == '()\n' |
||
18 | assert result.exit_code == 0 |
||
19 | assert 'trending_homebrew.cli.main' in result.output |
||
20 | help_result = runner.invoke(cli.main, ['--help']) |
||
21 | assert help_result.exit_code == 0 |
||
22 | assert '--help Show this message and exit.' in help_result.output |
||
23 | |||
24 | |||
25 | def test_longest(): |
||
26 | assert longest([b'a', b'bc', b'abc']) == b'abc' |
||
27 |