Completed
Push — develop ( cdffb7...b695d3 )
by Jace
02:39
created

tests.describe_gdm()   B

Complexity

Conditions 6

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 6
dl 0
loc 22
rs 7.7857

3 Methods

Rating   Name   Duplication   Size   Complexity  
A tests.it_exits_when_no_config_found() 0 5 2
A tests.it_launches_the_config() 0 5 1
A tests.describe_edit() 0 13 4
1
# pylint: disable=unused-variable,redefined-outer-name,expression-not-assigned
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
3
from unittest.mock import patch, call
4
5
import pytest
6
from expecter import expect
0 ignored issues
show
Configuration introduced by
The import expecter 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...
7
8
from gitman import cli
9
10
11
@pytest.fixture
12
def config(tmpdir):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
13
    tmpdir.chdir()
14
    path = str(tmpdir.join("gdm.yml"))
15
    open(path, 'w').close()
16
    return path
17
18
19
def describe_edit():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
20
21
    @patch('gitman.system.launch')
22
    def it_launches_the_config(launch, config):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
23
        cli.main(['edit'])
24
25
        expect(launch.mock_calls) == [call(config), call().__bool__()]
26
27
    def it_exits_when_no_config_found(tmpdir):
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
28
        tmpdir.chdir()
29
30
        with expect.raises(SystemExit):
31
            cli.main(['edit'])
32