#NEWLINE# def test_hash_format_sparse( self ) : #NEWLINE# #INDENT# h = self . rbp . hash_vector ( scipy . sparse . rand ( 100 , 1 , density = 0.1 ) ) #NEWLINE# self . assertEqual ( len ( h ) , 1 ) #NEWLINE# self . assertEqual ( type ( h [ 0 ] ) , type ( '' ) ) #NEWLINE# self . assertEqual ( len ( h [ 0 ] ) , 10 ) #NEWLINE# for c in self [ 0 ] : #NEWLINE# #INDENT# self . assertTrue ( ( ( c == '1' ) or ( c == '0' ) ) )