def test_200times_nested(self): r = [1, 2] for i in range(200): r = [r] self.assertEqual([1, 2, 3], q0008.flatten([r, 3]))
def test_various_types(self): self.assertEqual( [1, 'a', True, {}, (1, 2), set([1, 2])], q0008.flatten([[1, 'a'], [[True, {}], (1, 2)], set([1, 2])]))
def test_example(self): self.assertEqual([1, 2, 3], q0008.flatten([[1, 2], 3]))
def test_simple(self): self.assertEqual([1, 2, 3], q0008.flatten([1, 2, 3]))
def test_single(self): self.assertEqual([1], q0008.flatten([1]))
def test_empty(self): self.assertEqual([], q0008.flatten([]))