

@defer.inlineCallbacks
def test_batch(self):
    request = [{
        'jsonrpc': '2.0',
        'method': 'subtract',
        'params': [42, 23],
        'id': 1,
    }, {
        'jsonrpc': '2.0',
        'method': 'update',
        'params': [1, 2, 3, 4, 5],
    }, {
        'foo': 'bar',
    }, {
        'jsonrpc': '2.0',
        'method': 'subtract.foo',
        'params': {
            'subtrahend': 23,
            'minuend': 42,
        },
        'id': 2,
    }, {
        'jsonrpc': '2.0',
        'method': 'subtract',
        'params': {
            'subtrahend': 23,
            'minuend': 42,
        },
        'id': 3,
    }]
    expected = [{
        'error': {
            'code': (- 32600),
            'message': 'Invalid request',
        },
        'id': None,
        'jsonrpc': '2.0',
    }, {
        'error': {
            'code': (- 32601),
            'message': 'Method not found',
        },
        'id': 2,
        'jsonrpc': '2.0',
    }, {
        'id': 1,
        'jsonrpc': '2.0',
        'result': 19,
    }, {
        'id': 3,
        'jsonrpc': '2.0',
        'result': 19,
    }]
    (yield expected.makeRequest(request, expected))

dataset/ETHPy150Open flowroute/txjason/txjason/tests/test_service.py ServiceTestCase.test_batch/VarMisuse@269/421 `self`->`expected`