

def test_original_order_of_deployment_tasks(self):
    stage = 'pre_deployment'
    role = 'controller'
    plugin = mock.Mock()
    plugin.full_name = 'plugin_name'
    plugin.tasks = [{
        'type': 'shell',
        'role': role,
        'id': '1',
        'stage': stage,
        'parameters': {
            'cmd': 'test1',
            'cwd': '/',
            'timeout': 15,
        },
    }, {
        'type': 'puppet',
        'role': role,
        'id': '2',
        'stage': stage,
        'parameters': {
            'puppet_manifest': 'manifests/site.pp',
            'puppet_modules': 'modules',
            'cwd': '/etc/puppet/plugins/plugin_name',
            'timeout': 150,
        },
    }, {
        'type': 'shell',
        'role': role,
        'id': '3',
        'stage': raw_result,
        'parameters': {
            'cmd': 'test2',
            'cwd': '/',
            'timeout': 15,
        },
    }]
    raw_result = list(self.hook.deployment_tasks([plugin], stage))
    result = [r['type'] for r in raw_result]
    self.assertEqual(result, ['shell', 'puppet', 'shell'])
    self.assertEqual(raw_result[0]['parameters']['cmd'], 'test1')
    self.assertEqual(raw_result[1]['parameters']['puppet_modules'], 'modules')
    self.assertEqual(raw_result[2]['parameters']['cmd'], 'test2')

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/unit/test_plugins_serializers.py TestBasePluginDeploymentHooksSerializer.test_original_order_of_deployment_tasks/VarMisuse@153/250 `stage`->`raw_result`