for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from unittest import TestCase
test_optimizationController
(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
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.
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.
from unittest.mock import Mock
from grortir.main.model.core.optimization_status import OptimizationStatus
from grortir.main.pso.optimization_controller import OptimizationController
class TestOptimizationController(TestCase):
def setUp(self):
self.stage_success = Mock()
self.stage_success.optimization_status = OptimizationStatus.success
self.stage_failed = Mock()
self.stage_failed.optimization_status = OptimizationStatus.failed
self.stage_in_progress = Mock()
self.stage_in_progress.optimization_status = OptimizationStatus.in_progress
def test_should_stop_when_one_failed(self):
test_should_stop_when_one_failed
[a-z_][a-z0-9_]{2,30}$
self.assertFalse(OptimizationController.should_continue(
[self.stage_success, self.stage_failed]))
def test_should_continue_when_no_failed(self):
test_should_continue_when_no_failed
self.assertTrue(OptimizationController.should_continue(
[self.stage_success, self.stage_in_progress]))
def test_should_stop_when_all_success(self):
test_should_stop_when_all_success
self.assertFalse((OptimizationController.should_continue(
[self.stage_success, self.stage_success])))
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.