Completed
Push — status ( 924687 )
by Michael
09:41
created

test_status()   A

Complexity

Conditions 3

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 3
c 2
b 0
f 0
dl 0
loc 12
rs 9.4285
1
from click.testing import CliRunner
0 ignored issues
show
Configuration introduced by
The import click.testing could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
2
3
import changes
4
from changes.cli import main
5
6
7
def test_version():
8
    runner = CliRunner()
9
    result = runner.invoke(main, ['--version'])
10
    assert result.exit_code == 0
11
    assert result.output == 'changes %s\n' % changes.__version__
12
13
14
def test_init(git_repo_with_merge_commit):
15
    result = CliRunner().invoke(
16
        main,
17
        ['init'],
18
        env={'GITHUB_AUTH_TOKEN': 'foo'},
19
    )
20
    assert result.exit_code == 0
21
22
    expected_output = '\n'.join([
23
        'Indexing repository...',
24
        'Looking for Github auth token in the environment...',
25
        '',
26
    ])
27
    assert expected_output == result.output
28
29
30
def test_status(git_repo_with_merge_commit):
31
    result = CliRunner().invoke(
32
        main,
33
        ['status'],
34
        env={'GITHUB_AUTH_TOKEN': 'foo'},
35
    )
36
    assert 0 == result.exit_code
37
38
    expected_output = '\n'.join([
39
40
    ])
41
    assert expected_output == result.output
42