Completed
Push — master ( 80d6ff...d0b076 )
by Jace
16s
created

is_based_on_default()   A

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
# pylint: disable=unused-variable,expression-not-assigned,misplaced-comparison-constant,singleton-comparison
0 ignored issues
show
introduced by
Bad option value 'misplaced-comparison-constant'
Loading history...
introduced by
Bad option value 'singleton-comparison'
Loading history...
2
3
from pathlib import Path
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 memegen.domain import Font
9
10
11
def describe_font():
12
13
    @pytest.fixture
14
    def font():
15
        return Font(Path('mock_dir', 'FooBar.otf'))
16
17
    def describe_str():
18
19
        def is_based_on_name(font):
20
            expect(str(font)) == 'foobar'
21
22
    def describe_bool():
23
24
        def is_based_on_default(font):
25
            expect(bool(font)) == True
26
27
            font.DEFAULT = 'foobar'
28
            expect(bool(font)) == False
29
30
    def describe_name():
31
32
        def is_derived_from_filename(font):
33
            expect(font.name) == 'foobar'
34
35
        def it_replaces_underscores(font):
36
            font.path = Path('a_b')
37
            expect(font.name) == 'a-b'
38