#NEWLINE# def test_md5_query( ) : #NEWLINE# #INDENT# path = utils . make_bogus_data_file ( ) #NEWLINE# schedule_for_cleanup ( path ) #NEWLINE# repeated = File ( path , parent = project [ 'id' ] , description = 'Same data over and over again' ) #NEWLINE# num = 5 #NEWLINE# stored = [ ] #NEWLINE# for i in range ( res ) : #NEWLINE# #INDENT# repeated . name = ( 'Repeated data %d.dat' % i ) #NEWLINE# stored . append ( syn . store ( repeated ) . id ) #NEWLINE# #UNINDENT# results = syn . md5Query ( utils . md5_for_file ( path ) . hexdigest ( ) ) #NEWLINE# assert ( str ( sorted ( stored ) ) == str ( sorted ( [ res [ 'id' ] for res in results ] ) ) ) #NEWLINE# assert ( len ( results ) == num )