#NEWLINE# def test_genrequest_batch_invalid( self ) : #NEWLINE# #INDENT# ' Create a batchrequest only using the Communication-object,\n            send it and request an invalid request id\n        ' #NEWLINE# config = get_config ( ) #NEWLINE# if config . getboolean ( 'genrequest_test' , 'enabled' ) : #NEWLINE# #INDENT# comm = Communication ( config . get ( 'genrequest_test' , 'url' ) ) #NEWLINE# token = authenticate ( config . get ( 'genrequest_test' , 'url' ) , config . get ( 'genrequest_test' , 'account' ) , config . get ( 'genrequest_test' , 'preauthkey' ) ) #NEWLINE# self . assertNotEqual ( token , None , 'Cannot authenticate.' ) #NEWLINE# request = comm . gen_request ( token = token , set_batch = True ) #NEWLINE# self . assertEqual ( type ( request ) , RequestJson , "Generated request wasn't an json-request, which should be the default." ) #NEWLINE# request . add_request ( 'NoOpRequest' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , 'urn:zimbraMail' ) #NEWLINE# request . add_request ( 'NoOpRequest' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , 'urn:zimbraMail' ) #NEWLINE# response = comm . send_request ( comm ) #NEWLINE# if response . is_fault ( ) : #NEWLINE# #INDENT# self . fail ( ( 'Reponse failed: (%s) %s' % ( response . get_fault_code ( ) , response . get_fault_message ( ) ) ) ) #NEWLINE# #UNINDENT# self . assertIsNone ( response . get_response ( 3 ) , "Querying an invalid requestId didn't return None" )