#NEWLINE# def test_sparse_matrix( self ) : #NEWLINE# #INDENT# fixture = [ { #NEWLINE# #INDENT# 0 : 1 , #NEWLINE# #UNINDENT# } ] #NEWLINE# fixture . extend ( ( [ { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ] * 4 ) ) #NEWLINE# fixture . append ( { #NEWLINE# #INDENT# 1 : None , #NEWLINE# #UNINDENT# } ) #NEWLINE# fixture . extend ( ( [ { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ] * 11 ) ) #NEWLINE# fixture . append ( { #NEWLINE# #INDENT# 2 : 'Renato' , #NEWLINE# #UNINDENT# } ) #NEWLINE# fixture . extend ( ( [ { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ] * 37 ) ) #NEWLINE# fixture . append ( { #NEWLINE# #INDENT# 3 : '' , #NEWLINE# #UNINDENT# } ) #NEWLINE# result = self . data . encode_data ( line , self . attributes ) #NEWLINE# self . assertTrue ( isinstance ( result , types . GeneratorType ) ) #NEWLINE# lines = [ line for line in result ] #NEWLINE# self . assertEqual ( lines [ 0 ] , '{ 0 1 }' ) #NEWLINE# self . assertEqual ( lines [ 1 ] , '{  }' ) #NEWLINE# self . assertEqual ( lines [ 55 ] , '{ 3 ? }' ) #NEWLINE# self . assertEqual ( len ( lines ) , 56 )