def test_more_than_two_arguments(self): in1 = [1, 2, 3] in2 = [4, 5, 6] in3 = [7, 8, 9] out = [1, 4, 7, 2, 5, 8, 3, 6, 9] self.assertEqual(interleave(in1, in2, in3), out)
def test_none_value(self): in1 = [1, 2, 3, None] in2 = [4, 5, 6, 7] out = [1, 4, 2, 5, 3, 6, None, 7] self.assertEqual(interleave(in1, in2), out)
def test_four_items_each(self): in1 = [1, 2, 3, 4] in2 = [5, 6, 7, 8] out = [1, 5, 2, 6, 3, 7, 4, 8] self.assertEqual(interleave(in1, in2), out)
def test_two_items_each(self): self.assertEqual(interleave([1, 2], [3, 4]), [1, 3, 2, 4])
def test_single_item_each(self): self.assertEqual(interleave([1], [2]), [1, 2])
def test_empty_lists(self): self.assertEqual(interleave([], []), [])