#NEWLINE# def test_batch( self ) : #NEWLINE# #INDENT# json = ( '[{"method": "echo", "id": 1, "params": {"data": "arg"}}, ' + '{"method": "echo", "id": 2, "params": {"data": "arg"}}]' ) #NEWLINE# request = DummyRequest ( [ '' ] ) #NEWLINE# request . content = StringIO ( json ) #NEWLINE# d = _render ( self . srv , request ) #NEWLINE# def rendered( _ ) : #NEWLINE# #INDENT# expected = ( '[{"error": null, "id": 1, "result": "arg"}, ' + '{"error": null, "id": 2, "result": "arg"}]' ) #NEWLINE# self . assertEquals ( request . written [ 0 ] , expected ) #NEWLINE# #UNINDENT# d . addCallback ( rendered ) #NEWLINE# return d