Completed
Push — master ( 5184e2...aa81f7 )
by Jace
01:57
created

tests.test_cli.runner()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
"""Sample integration test module using pytest-describe and expecter."""
2
# pylint: disable=redefined-outer-name,unused-variable,expression-not-assigned
3
4
import pytest
5
from click.testing import CliRunner
6
from expecter import expect
7
8
from demo.cli import main
9
10
11
@pytest.fixture
12
def runner():
13
    return CliRunner()
14
15
16
def describe_cli():
17
    def describe_conversion():
18
        def when_integer(runner):
19
            result = runner.invoke(main, ['42'])
20
21
            expect(result.exit_code) == 0
22
            expect(result.output) == "12.80165\n"
23
24
        def when_invalid(runner):
25
            result = runner.invoke(main, ['foobar'])
26
27
            expect(result.exit_code) == 0
28
            expect(result.output) == ""
29