Completed
Push — develop ( 8e3cf4...604c57 )
by Jace
01:38
created

it_retries_500s()   A

Complexity

Conditions 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
dl 0
loc 10
rs 9.4285
c 1
b 0
f 0
1
# pylint: disable=unused-variable,expression-not-assigned,singleton-comparison
0 ignored issues
show
introduced by
Bad option value 'singleton-comparison'
Loading history...
2
3
from mock import patch, Mock
0 ignored issues
show
Configuration introduced by
The import mock 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...
4
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...
5
6
from coveragespace import cli
7
8
9
def describe_call():
10
11
    @patch('coveragespace.cache.Cache.get', Mock())
12
    def it_handles_invalid_response():
13
        expect(cli.call('slug', 'metric', 42)) == False
14
15
    @patch('coveragespace.cache.Cache.get', Mock(return_value=None))
16
    @patch('coveragespace.cache.Cache.set', Mock(return_value=None))
17
    @patch('time.sleep', Mock())
18
    @patch('requests.put')
19
    def it_retries_500s(requests_put):
20
        requests_put.return_value = Mock(status_code=500)
21
22
        cli.call('slug', 'metric', 42)
23
24
        expect(requests_put.call_count) == 3
25