def test_result(self):
     self.assertEqual(
         MavenGeneric.step_implementer_config_defaults(), {
             'pom-file': 'pom.xml',
             'tls-verify': True,
             'maven-profiles': [],
             'maven-additional-arguments': [],
             'maven-no-transfer-progress': True
         })
    def test_use_object_property_no_config_value(self):
        workflow_result = WorkflowResult()
        parent_work_dir_path = '/fake/path'
        config = None

        step_implementer = MavenGeneric(
            workflow_result=workflow_result,
            parent_work_dir_path=parent_work_dir_path,
            config=config,
            maven_phases_and_goals=['fake-phase'])

        self.assertEqual(step_implementer.maven_phases_and_goals,
                         ['fake-phase'])
Example #3
0
    def step_implementer_config_defaults():
        """Getter for the StepImplementer's configuration defaults.

        Returns
        -------
        dict
            Default values to use for step configuration values.

        Notes
        -----
        These are the lowest precedence configuration values.
        """
        return {
            **MavenGeneric.step_implementer_config_defaults(),
            **DEFAULT_CONFIG
        }
    def test_no_environment_no_maven_phases_and_goals(self, mock_super_init):
        workflow_result = WorkflowResult()
        parent_work_dir_path = '/fake/path'
        config = {}

        step_implementer = MavenGeneric(
            workflow_result=workflow_result,
            parent_work_dir_path=parent_work_dir_path,
            config=config)

        self.assertIsNone(step_implementer._MavenGeneric__maven_settings_file)
        self.assertIsNone(
            step_implementer._MavenGeneric__maven_phases_and_goals)
        mock_super_init.assert_called_once_with(
            workflow_result=workflow_result,
            parent_work_dir_path=parent_work_dir_path,
            config=config,
            environment=None)
    def test_use_object_property_with_config_value(self):
        workflow_result = WorkflowResult()
        parent_work_dir_path = '/fake/path'
        step_config = {'maven-phases-and-goals': ['config-value-fake-phase']}
        config = Config({
            Config.CONFIG_KEY: {
                'foo': [{
                    'implementer': 'MavenGeneric',
                    'config': step_config
                }]
            }
        })

        step_implementer = MavenGeneric(
            workflow_result=workflow_result,
            parent_work_dir_path=parent_work_dir_path,
            config=config,
            maven_phases_and_goals=['object-property-fake-phase'])

        self.assertEqual(step_implementer.maven_phases_and_goals,
                         ['object-property-fake-phase'])
 def test_result(self):
     self.assertEqual(MavenGeneric._required_config_or_result_keys(),
                      ['pom-file', 'maven-phases-and-goals'])