def test_compare3_file_name_with_comma_in_storage_dump_ATLDDMOPS_4105(self): ''' DUMPER ''' rucio_replica_dump = 'user/mfauccig/8d/46/user.mfauccig.410000.PowhegPythiaEvtGen.DAOD_TOPQ1.e3698_s2608_s2183_r6630_r6264_p2377.v1.log.6466214.000001.log.tgz,A' storage_dump = 'user/mdobre/01/6b/user.mdobre.C1C1bkg.WWVBH,nometcut.0711.log.4374089.000029.log.tgz' results = list(compare3([rucio_replica_dump], [storage_dump], [rucio_replica_dump])) eq_( results, [ ( 'user/mdobre/01/6b/user.mdobre.C1C1bkg.WWVBH,nometcut.0711.log.4374089.000029.log.tgz', (False, True, False), (None, None), ), ( 'user/mfauccig/8d/46/user.mfauccig.410000.PowhegPythiaEvtGen.DAOD_TOPQ1.e3698_s2608_s2183_r6630_r6264_p2377.v1.log.6466214.000001.log.tgz', (True, False, True), ('A', 'A'), ), ], )
def test_compare3(self): ''' DUMPER ''' sorted_rdd_1 = sorted(self.case_mixed_rrd_1, key=lambda s: s.split(',')[0]) sorted_rdd_2 = sorted(self.case_mixed_rrd_2, key=lambda s: s.split(',')[0]) sorted_sed = sorted(self.case_mixed_sed) value = sorted(list(compare3(sorted_rdd_1, sorted_sed, sorted_rdd_2))) expected = sorted([ ('path1', (True, True, True), ('A', 'A')), ('path20', (True, True, True), ('U', 'A')), ('path01', (True, False, True), ('U', 'U')), ('path23', (True, False, False), ('U', None)), ('path26', (True, False, True), ('A', 'A')), ('path6', (True, False, True), ('A', 'A')), ('path66', (False, True, False), (None, None)), ('path46', (False, True, False), (None, None)), ('pathsda', (False, True, False), (None, None)), ]) assert value == expected