#NEWLINE# def test_invalid_json_command_causes_parse_error( self ) : #NEWLINE# #INDENT# request = '{"jsonrpc": "2.0", "method": "foobar, "params": "bar", "baz]' #NEWLINE# response = self . jrw . handle_json ( request ) #NEWLINE# response = json . loads ( response ) #NEWLINE# self . assertEqual ( response [ 'jsonrpc' ] , '2.0' ) #NEWLINE# error = response [ 'error' ] #NEWLINE# self . assertEqual ( error [ 'code' ] , ( - 32700 ) ) #NEWLINE# self . assertEqual ( error [ 'message' ] , 'Parse error' )