Esempio n. 1
0
    def test_parallel_loops(self):

        steps = Steps()
        data = yaml.safe_load(self.yaml3)
        self.blitz_obj.parameters['save_variable_name'] = {}
        self.blitz_obj.parameters['save_variable_name'][
            'execute_id'] = 'passed'
        self.kwargs.update({
            'self': self.blitz_obj,
            'data': data,
            'steps': steps
        })

        # TODO alias and saved_vars wont get stored when under loop/run_condition
        # self.assertIn('exec_1', self.blitz_obj.parameters['save_variable_name'])
        parallel(**self.kwargs)
        self.assertIn('parse_id',
                      self.blitz_obj.parameters['save_variable_name'])
        self.assertEqual(steps.result, Failed)
        self.assertEqual(steps.details[0].name,
                         'Executing actions in parallel')
        self.assertEqual(
            steps.details[1].name,
            'Condition %VARIABLES{execute_id} == passed is met and '
            'the step result is failed')
        self.assertEqual(steps.details[1].result, Failed)
Esempio n. 2
0
    def test_parallel_actions_fail(self):

        steps = Steps()
        data = yaml.safe_load(self.yaml2)
        self.kwargs.update({'data': data, 'steps': steps})
        parallel(**self.kwargs)
        self.assertEqual(steps.result, Failed)
        self.assertEqual(
            self.blitz_obj.parameters['save_variable_name']['execute_id'],
            'failed')