def test_multiple_duplicates(self): dups = duplicates(list('abC_dEfgCh_iEjE__k')) assert sorted(dups) == sorted(['C', 'E', '_'])
def test_no_duplicates(self): assert duplicates([1]) == [] assert duplicates([1, 2, 3, 4]) == []
def test_one_duplicate(self): assert duplicates([1, 1]) == [1] assert duplicates([1, 1, 2]) == [1] assert duplicates([1, 2, 1]) == [1] assert duplicates([2, 1, 1]) == [1] assert duplicates(list('abCdefgChi')) == ['C']
def test_empty(self): assert duplicates(None) == [] assert duplicates([]) == []