#NEWLINE# def testRecordsReader( self ) : #NEWLINE# #INDENT# 'End-to-end test for records reader.' #NEWLINE# input_data = [ str ( i ) for i in range ( 100 ) ] #NEWLINE# bucket_name = 'testbucket' #NEWLINE# test_filename = 'testfile' #NEWLINE# full_filename = ( '/%s/%s' % ( bucket_name , test_filename ) ) #NEWLINE# with cloudstorage . open ( full_filename , mode = 'w' ) as f : #NEWLINE# #INDENT# with records . RecordsWriter ( f ) as w : #NEWLINE# #INDENT# for record in input_data : #NEWLINE# #INDENT# w . write ( record ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# control . start_map ( 'test_map' , ( __name__ + '.TestHandler' ) , ( input_readers . __name__ + '.GoogleCloudStorageRecordInputReader' ) , { #NEWLINE# #INDENT# 'input_reader' : { #NEWLINE# #INDENT# 'bucket_name' : bucket_name , #NEWLINE# 'objects' : [ test_filename ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , shard_count = 4 , base_path = '/mapreduce_base_path' ) #NEWLINE# test_support . execute_until_empty ( self . taskqueue ) #NEWLINE# self . assertEquals ( 100 , len ( TestHandler . processed_entites ) )