def test_transfer_plugin_settings_fail(mocker):
    plugin = mock.Mock()
    mocker.patch.object(update_plugin_settings, 'PLUGINS', {'plugin': plugin})
    env_cls = mocker.patch('fuelclient.objects.environment.Environment')
    mocker.patch('octane.util.env.get_astute_yaml')
    attrs = {'editable': {'plugin1': {}}}
    env_cls.return_value.get_settings_data.return_value = attrs
    with pytest.raises(update_plugin_settings.PluginNotConfigured):
        update_plugin_settings.transfer_plugins_settings(1, 2, ['plugin'])
Exemple #2
0
def test_transfer_plugin_settings_fail(mocker):
    plugin = mock.Mock()
    mocker.patch.object(update_plugin_settings, 'PLUGINS', {'plugin': plugin})
    env_cls = mocker.patch('fuelclient.objects.environment.Environment')
    mocker.patch('octane.util.env.get_astute_yaml')
    attrs = {'editable': {'plugin1': {}}}
    env_cls.return_value.get_settings_data.return_value = attrs
    with pytest.raises(update_plugin_settings.PluginNotConfigured):
        update_plugin_settings.transfer_plugins_settings(1, 2, ['plugin'])
def test_transfer_plugin_settings(mocker):
    plugin = mock.Mock()
    mocker.patch.object(update_plugin_settings, 'PLUGINS', {'plugin': plugin})
    env_cls = mocker.patch('fuelclient.objects.environment.Environment')
    get_astute_yaml = mocker.patch('octane.util.env.get_astute_yaml')
    attrs = {'editable': {'plugin': {}}}
    env_cls.return_value.get_settings_data.return_value = attrs
    update_plugin_settings.transfer_plugins_settings(1, 2, ['plugin'])
    plugin.assert_called_once_with(get_astute_yaml.return_value, {})
Exemple #4
0
def test_transfer_plugin_settings(mocker):
    plugin = mock.Mock()
    mocker.patch.object(update_plugin_settings, 'PLUGINS', {'plugin': plugin})
    env_cls = mocker.patch('fuelclient.objects.environment.Environment')
    get_astute_yaml = mocker.patch('octane.util.env.get_astute_yaml')
    attrs = {'editable': {'plugin': {}}}
    env_cls.return_value.get_settings_data.return_value = attrs
    update_plugin_settings.transfer_plugins_settings(1, 2, ['plugin'])
    plugin.assert_called_once_with(get_astute_yaml.return_value, {})