def get_citations(texfilenames): """ Get all citations in tex files Citations appear only once. :param texfilenames: tex files path :returns: a list of citations """ allcite = [] for texfilename in texfilenames: allcite.extend(_get_citations(texfilename)) #uniqify the list #A set could not be used since the order might have a sense allcite = uniq(allcite) return allcite
def test_complete_list(self): data = ['a', 'b', 'c', 'b'] expected = ['a', 'b', 'c'] result = uniq(data) self.assertEqual(expected, result)
def test_simple_list(self): data = ['a', 'b', 'c'] expected = data result = uniq(data) self.assertEqual(expected, result)