def METHOD_NAME(function_scope_coinbasepro):
    """Test that an invalid response is handled when querying balances from coinbasepro"""
    cb = function_scope_coinbasepro
    cb_query_mock = create_coinbasepro_query_mock(
        cb,
        emulate_errors=ErrorEmulation.INVALID_RESPONSE,
    )
    with cb_query_mock:
        balances, message = cb.query_balances()
    assert balances is None
    assert 'returned invalid JSON response' in message
    warnings = cb.msg_aggregator.consume_warnings()
    assert len(warnings) == 0
    errors = cb.msg_aggregator.consume_errors()
    assert len(errors) == 0