Example #1
0
 def test_flattened_chain(self):
     lst = [0, 1, [2, 3], [4, [5, 6]], [7]]
     flattened_lst = range(8)
     self.assertEquals(flattened_lst, list(flattened_chain(lst)))
Example #2
0
 def _make_commands(self):
     command_tree = self._get_commands()
     return command_tree, list(flattened_chain(command_tree))