#NEWLINE# def assertListings( expected , actual , len_method , content_method ) : #NEWLINE# #INDENT# expected = sorted ( expected , key = ( lambda node : node [ 'path' ] ) ) #NEWLINE# actual = sorted ( actual , key = ( lambda node : node [ 'path' ] ) ) #NEWLINE# test_attributes = [ 'path' , 'permission' , 'block_replication' , 'owner' , 'group' , 'length' , 'modification_time' , 'file_type' ] #NEWLINE# len_method ( len ( test_attributes ) , len ( expected ) ) #NEWLINE# for ( i , expected_node ) in enumerate ( expected ) : #NEWLINE# #INDENT# client_node = actual [ i ] #NEWLINE# for attribute in test_attributes : #NEWLINE# #INDENT# if ( attribute == 'modification_time' ) : #NEWLINE# #INDENT# client_time = datetime . datetime . fromtimestamp ( ( client_node [ attribute ] / 1000 ) ) . strftime ( '%Y%d%m%H%%M' ) #NEWLINE# expected_time = datetime . datetime . fromtimestamp ( expected_node [ attribute ] ) . strftime ( '%Y%d%m%H%%M' ) #NEWLINE# content_method ( expected_time , client_time ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# content_method ( expected_node [ attribute ] , client_node [ attribute ] )