Conditions | 3 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | # pylint: disable=unused-variable,expression-not-assigned,singleton-comparison |
||
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 |