Exemple #1
0
 def test_multiple_duplicates(self):
     dups = duplicates(list('abC_dEfgCh_iEjE__k'))
     assert sorted(dups) == sorted(['C', 'E', '_'])
Exemple #2
0
 def test_no_duplicates(self):
     assert duplicates([1]) == []
     assert duplicates([1, 2, 3, 4]) == []
Exemple #3
0
 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']
Exemple #4
0
 def test_empty(self):
     assert duplicates(None) == []
     assert duplicates([]) == []