Exemple #1
0
    def test_use_object_property_with_config_value(self):
        workflow_result = WorkflowResult()
        parent_work_dir_path = '/fake/path'
        step_config = {
            'tox-env': 'config-value-fake-env'
        }
        config = Config({
            Config.CONFIG_KEY: {
                'foo': [
                    {
                        'implementer': 'ToxGeneric',
                        'config': step_config
                    }
                ]

            }
        })

        step_implementer = ToxGeneric(
            workflow_result=workflow_result,
            parent_work_dir_path=parent_work_dir_path,
            config=config,
            tox_env='object-property-fake-env'
        )

        self.assertEqual(
            step_implementer.tox_env,
            'object-property-fake-env'
        )
Exemple #2
0
 def test_result(self):
     self.assertEqual(
         ToxGeneric._required_config_or_result_keys(),
         [
             'tox-config',
             'tox-env'
         ]
     )
Exemple #3
0
 def test_result(self):
     self.assertEqual(
         ToxGeneric.step_implementer_config_defaults(),
         {
             'tox-config': 'tox.ini',
             'quiet': True
         }
     )
Exemple #4
0
    def test_use_object_property_no_config_value(self):
        workflow_result = WorkflowResult()
        parent_work_dir_path = '/fake/path'
        config = None

        step_implementer = ToxGeneric(
            workflow_result=workflow_result,
            parent_work_dir_path=parent_work_dir_path,
            config=config,
            tox_env='test')

        self.assertEqual(step_implementer.tox_env, 'test')
Exemple #5
0
    def test_no_environment_no_tox_args(self, mock_super_init):
        workflow_result = WorkflowResult()
        parent_work_dir_path = '/fake/path'
        config = {}

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

        self.assertIsNone(step_implementer._ToxGeneric__tox_env)
        mock_super_init.assert_called_once_with(
            workflow_result=workflow_result,
            parent_work_dir_path=parent_work_dir_path,
            config=config,
            environment=None)