Ejemplo n.º 1
0
 def test_level2(self):
     result = flatten(self.list_1, self.list_2, 2)
     expected = [1, 2, 3, 4, 5, 6, 7, [8, 9], 10, 11, 12, 19, 20, 21, 13, [14, 15, [16, 17, 18]]]
     self.assertEqual(result, expected)
Ejemplo n.º 2
0
 def test_level4(self):
     result = flatten(self.list_1, self.list_2, 4)
     expected = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 19, 20, 21, 13, 14, 15, 16, 17, 18]
     self.assertEqual(result, expected)
Ejemplo n.º 3
0
 def test_level1(self):
     result = flatten(self.list_1, self.list_2, 1)
     expected = [1, 2, 3, 4, [5, 6, 7, [8, 9]], 10, [11, 12], 19, [20, 21], [13, [14, 15, [16, 17, 18]]]]
     self.assertEqual(result, expected)