Test Failed
Push — main ( b75c67...4e8f49 )
by John Patrick
01:44
created

test_trending_homebrew   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2
1
#!/usr/bin/env python
2
3
"""Tests for `trending_homebrew` package."""
4
5
import pytest
0 ignored issues
show
introduced by
Unable to import 'pytest'
Loading history...
Unused Code introduced by
The import pytest seems to be unused.
Loading history...
6
7
from click.testing import CliRunner
0 ignored issues
show
introduced by
Unable to import 'click.testing'
Loading history...
8
9
from trending_homebrew import trending_homebrew
0 ignored issues
show
introduced by
Unable to import 'trending_homebrew'
Loading history...
Unused Code introduced by
Unused trending_homebrew imported from trending_homebrew
Loading history...
10
from trending_homebrew import longest
0 ignored issues
show
introduced by
Unable to import 'trending_homebrew'
Loading history...
11
from trending_homebrew import cli
0 ignored issues
show
introduced by
Unable to import 'trending_homebrew'
Loading history...
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():
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
26
    assert longest([b'a', b'bc', b'abc']) == b'abc'
27