Exemple #1
0
 def testEmptyList(self):
     self.assertEqual([1, 2, 7], flatten([[1, 2], [], [7], []]))
Exemple #2
0
 def testSingleElement(self):
     self.assertEqual([1, 2, 2, 3, 7, 8, 7], flatten([[1, 2, 2, 3, 7, 8,
                                                       7]]))
Exemple #3
0
 def testFlatten(self):
     self.assertEqual([1, 2, 3, 7, 8], flatten([[1, 2], [3, 7], [8]]))
Exemple #4
0
 def testDuplicate(self):
     self.assertEqual([1, 2, 2, 3, 7, 8, 7],
                      flatten([[1, 2], [2, 3], [7], [8, 7]]))