Total Complexity | 4 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | from unittest import TestCase |
||
8 | class TestOptimizationController(TestCase): |
||
9 | def setUp(self): |
||
10 | self.stage_success = Mock() |
||
11 | self.stage_success.optimization_status = OptimizationStatus.success |
||
12 | self.stage_failed = Mock() |
||
13 | self.stage_failed.optimization_status = OptimizationStatus.failed |
||
14 | self.stage_in_progress = Mock() |
||
15 | self.stage_in_progress.optimization_status = OptimizationStatus.in_progress |
||
16 | |||
17 | def test_should_stop_when_one_failed(self): |
||
18 | self.assertFalse(OptimizationController.should_continue( |
||
19 | [self.stage_success, self.stage_failed])) |
||
20 | |||
21 | def test_should_continue_when_no_failed(self): |
||
22 | self.assertTrue(OptimizationController.should_continue( |
||
23 | [self.stage_success, self.stage_in_progress])) |
||
24 | |||
25 | def test_should_stop_when_all_success(self): |
||
26 | self.assertFalse((OptimizationController.should_continue( |
||
27 | [self.stage_success, self.stage_success]))) |
||
28 |
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.