Ejemplo n.º 1
0
 def test_flat_prepend(self):
     l = FlatList([1])
     l.flat_prepend([2])
     assert l == [2, 1]
     assert l.flat_prepend(3) == [3, 2, 1]
Ejemplo n.º 2
0
 def test_flatten(self):
     l = FlatList([1, [2, [3]]])
     assert l.flatten() == [1, 2, 3]
     assert l == [1, 2, 3]
Ejemplo n.º 3
0
 def test_flat_append(self):
     l = FlatList([1])
     l.flat_append([2])
     assert l == [1, 2]
     assert l.flat_append(3) == [1, 2, 3]
Ejemplo n.º 4
0
 def test_prepend(self):
     l = FlatList([1])
     l.prepend(2)
     assert l == [2, 1]