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