def insights_update(ctx, declaration): """ command """ insights_client = InsightsClient(get_mgmt_client()) ctx.log( insights_client.create( config_file=utils_core.convert_to_absolute(declaration)))
def test_insights_client_update_config_file(mgmt_client, mocker): """Test: Beacon Insights client update() - with config_file Assertions ---------- - Beacon Insights client create() return value should be mocked response """ mocker.patch('f5sdk.utils.file_utils.open', mocker.mock_open(read_data=json.dumps({}))) mocker.patch(REQUESTS).return_value.json = Mock(return_value={}) insights_client = InsightsClient(mgmt_client) assert insights_client.create(config_file='/foo.json') == {}