def test_insights_client_delete_with_title(mgmt_client, mocker):
        """Test: Beacon Insights client update() - with config_file

        Assertions
        ----------
        - Beacon Insights client create() return value should be mocked response
        """

        mocker.patch(REQUESTS).return_value.json = Mock(return_value={})

        insights_client = InsightsClient(mgmt_client)
        assert insights_client.delete(name='blah') == {}
Example #2
0
def insight_delete(ctx, name, auto_approve):
    """ command """
    approval_confirmation_map = {
        'delete': 'Insight named %s will be deleted' % name
    }
    utils_core.verify_approval('delete', approval_confirmation_map,
                               auto_approve)
    insights_client = InsightsClient(get_mgmt_client())
    result = insights_client.delete(name=name, config={})
    if result == {}:
        ctx.log('Insight deleted successfully')
    else:
        ctx.log(result)