def test__get_step_implementer_name_class_does_not_exist_given_module_path(self): with self.assertRaisesRegex( StepRunnerException, r"Could not dynamically load step \(foo\) step implementer" r" \(tests.helpers.sample_step_implementers.DoesNotExist\) from module \(tests.helpers.sample_step_implementers\) with class name \(DoesNotExist\)"): StepRunner._StepRunner__get_step_implementer_class('foo', 'tests.helpers.sample_step_implementers.DoesNotExist')
def test__get_step_implementer_name_class_is_not_subclass_of_StepImplementer(self): with self.assertRaisesRegex( StepRunnerException, re.compile( r"Step \(foo\) is configured to use step implementer " r"\(tests.helpers.sample_step_implementers.NotSubClassOfStepImplementer\) " r"from module \(tests.helpers.sample_step_implementers\) with class name " r"\(NotSubClassOfStepImplementer\), and dynamically loads as class " r"\(<class 'tests.helpers.sample_step_implementers.NotSubClassOfStepImplementer'>\) " r"which is not a subclass of required parent class " r"\(<class 'ploigos_step_runner.step_implementer.StepImplementer'>\)." ) ): StepRunner._StepRunner__get_step_implementer_class('foo', 'tests.helpers.sample_step_implementers.NotSubClassOfStepImplementer')
def test__get_step_implementer_class_exists_include_module(self): self.assertIsNotNone( StepRunner._StepRunner__get_step_implementer_class( 'foo', 'tests.helpers.sample_step_implementers.FooStepImplementer' ) )
def test__get_step_implementer_class_exists_defaultt_steps_module(self): self.assertIsNotNone( StepRunner._StepRunner__get_step_implementer_class('container_image_static_compliance_scan', 'OpenSCAP') )
def test__get_step_implementer_class_does_not_exist_using_default_steps_module(self): with self.assertRaisesRegex( StepRunnerException, r"Could not dynamically load step \(foo\) step implementer \(bar\) " r"from module \(ploigos_step_runner.step_implementers.foo\) with class name \(bar\)"): StepRunner._StepRunner__get_step_implementer_class('foo', 'bar')