def test_remove_duplicates_querry(bibs, mock_input): # Querry-solve duplicate: my_bibs = [bibs["beaulieu_arxiv"], bibs["beaulieu_arxiv_dup"]] bm.remove_duplicates(my_bibs, "eprint") assert len(my_bibs) == 1 # Note that the mocked input '2' applies on the sorted entries # (which, in fact, has swapped the values as seen above in my_bibs) assert my_bibs == [bibs["beaulieu_arxiv"]]
def test_remove_duplicates_identical(bibs): # Identical entries: my_bibs = [bibs["beaulieu_apj"], bibs["beaulieu_apj"]] bm.remove_duplicates(my_bibs, "doi") assert my_bibs == [bibs["beaulieu_apj"]]
def test_remove_duplicates_diff_published(bibs): # Duplicate, differente published status my_bibs = [bibs["beaulieu_apj"], bibs["beaulieu_arxiv"]] bm.remove_duplicates(my_bibs, "eprint") assert len(my_bibs) == 1 assert my_bibs == [bibs["beaulieu_apj"]]
def test_remove_duplicates_no_duplicates(bibs): # No duplicates, no removal: my_bibs = [bibs['beaulieu_apj'], bibs['stodden']] bm.remove_duplicates(my_bibs, "doi") assert len(my_bibs) == 2