def test_default_guess_edits(self): """default_guess_edits matches a new entry only once. (Even when that entry is the best match for multiple old entries.) """ new_in_other = [('AAAAA',), ('BBBBB',)] deleted_in_other = [('DDDDD',), ('BBBBBx',), ('BBBBBxx',)] # BBBBB is the best match for both BBBBBx and BBBBBxx result = changelog_merge.default_guess_edits( new_in_other, deleted_in_other) self.assertEqual( ([('AAAAA',)], # new [('DDDDD',), ('BBBBBxx',)], # deleted [(('BBBBBx',), ('BBBBB',))]), # edits result)
def guess_edits(new, deleted): #import pdb; pdb.set_trace() return changelog_merge.default_guess_edits(new, deleted, entry_as_str=lambda x: x)