

@defer.inlineCallbacks
def test_cancel_pending(self):
    d1 = self.service.call(json.dumps({
        'jsonrpc': '2.0',
        'method': 'delay',
        'params': [10],
        'id': '1',
    }))
    d2 = self.service.call(json.dumps({
        'jsonrpc': '2.0',
        'method': 'delay',
        'params': [10],
        'id': '2',
    }))
    self.service.cancelPending()
    r1 = (yield d1)
    r2 = (yield d2)
    e1 = {
        'jsonrpc': '2.0',
        'error': {
            'code': (- 32098),
            'message': 'Server Timeout',
        },
        'id': '1',
    }
    e2 = {
        'jsonrpc': '2.0',
        'error': {
            'code': (- 32098),
            'message': 'Server Timeout',
        },
        'id': '2',
    }
    self.assertEqual(json.loads(r1), e1)
    self.assertEqual(json.loads(r1), e2)

dataset/ETHPy150Open flowroute/txjason/txjason/tests/test_service.py ServiceTestCase.test_cancel_pending/VarMisuse@211/297 `r2`->`r1`