Completed
Push — develop ( c9c7a4...e6cfa4 )
by Jace
02:12
created

gdm.test.describe_launch()   A

Complexity

Conditions 4

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 4
dl 0
loc 12
rs 9.2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A gdm.test.it_opens_files() 0 5 1
A gdm.test.it_raises_an_exception_when_platform_is_unknown() 0 4 2
1
# pylint: disable=unused-variable,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, Mock
4
5
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...
6
7
from gdm import system
8
9
10
def describe_launch():
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...
11
12
    @patch('platform.system', Mock(return_value="Windows"))
13
    @patch('gdm.system._launch_windows')
14
    def it_opens_files(startfile):
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...
15
        system.launch("fake/path")
16
        expect(startfile.mock_calls) == [call("fake/path")]
17
18
    @patch('platform.system', Mock(return_value="fake"))
19
    def it_raises_an_exception_when_platform_is_unknown():
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
        with expect.raises(RuntimeError):
21
            system.launch(None)
22