#NEWLINE# def testSerialization( self ) : #NEWLINE# #INDENT# mr_spec = self . mr_state . mapreduce_spec #NEWLINE# shard_state = self . create_shard_state ( 0 ) #NEWLINE# ctx = context . Context ( mr_spec , shard_state ) #NEWLINE# context . Context . _set ( ctx ) #NEWLINE# writer = self . WRITER_CLS . create ( mr_spec , 0 , 0 ) #NEWLINE# writer . _seg_index = 1 #NEWLINE# writer . write ( 'abcde' ) #NEWLINE# writer = self . WRITER_CLS . from_json_str ( writer . to_json_str ( ) ) #NEWLINE# self . assertEqual ( 1 , writer . _seg_index ) #NEWLINE# self . assertEqual ( len ( 'abcde' ) , writer . _seg_valid_length )