Test Setup Failed
Push — master ( 8ed87e...2c662a )
by Jace
01:17
created

describe_run()   A

Complexity

Conditions 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
1
# pylint: disable=redefined-outer-name,unused-variable,expression-not-assigned,singleton-comparison
2
3
import pytest
4
from expecter import expect
5
6
from click.testing import CliRunner
7
8
from envdiff.cli import main
9
10
11
@pytest.fixture
12
def runner():
13
    return CliRunner()
14
15
16
def describe_cli():
17
18
    def describe_init():
19
20
        def when_config_missing(runner, tmpdir):
21
            tmpdir.chdir()
22
23
            result = runner.invoke(main, ['--init'])
24
25
            expect(result.output) == (
26
                "Generated config file: {}/env-diff.yml\n".format(tmpdir) +
27
                "Edit this file to match your application\n"
28
            )
29
            expect(result.exit_code) == 0
30
31
    def describe_run():
32
33
        def when_config_missing(runner, tmpdir):
34
            tmpdir.chdir()
35
36
            result = runner.invoke(main, [])
37
38
            expect(result.output) == \
39
                "No config file found, generate one with '--init'\n"
40
            expect(result.exit_code) == 1
41