#NEWLINE# def test_intersection( self ) : #NEWLINE# #INDENT# bloom_one = BloomFilter ( 100 , 0.001 ) #NEWLINE# bloom_two = BloomFilter ( 100 , 0.001 ) #NEWLINE# chars = [ chr ( i ) for i in range_fn ( 97 , 123 ) ] #NEWLINE# for char in chars : #NEWLINE# #INDENT# bloom_one . add ( char ) #NEWLINE# #UNINDENT# for char in chars [ : int ( ( len ( chars ) / 2 ) ) ] : #NEWLINE# #INDENT# bloom_two . add ( char ) #NEWLINE# #UNINDENT# new_bloom = bloom_one . intersection ( bloom_two ) #NEWLINE# for char in bloom_two [ : int ( ( len ( chars ) / 2 ) ) ] : #NEWLINE# #INDENT# self . assertTrue ( ( char in new_bloom ) ) #NEWLINE# #UNINDENT# for char in chars [ int ( ( len ( chars ) / 2 ) ) : ] : #NEWLINE# #INDENT# self . assertTrue ( ( char not in new_bloom ) )