Example #1
0
 def test_is_iterator(self):
     numbers = all_together([1, 2], (3, 4))
     output = all_together(numbers, (5, 6))
     self.assertEqual(next(output), 1)
     self.assertEqual(next(numbers), 2)
Example #2
0
 def test_iterator(self):
     outputs = all_together([1], [2])
     self.assertEqual(list(outputs), [1, 2])
     self.assertEqual(list(outputs), [])
Example #3
0
 def test_with_strings(self):
     outputs = list(all_together([1, 2], (3, 4), "hello"))
     expected = [1, 2, 3, 4, 'h', 'e', 'l', 'l', 'o']
     self.assertEqual(outputs, expected)
Example #4
0
 def test_empty_list(self):
     outputs = list(all_together([], (), '', [1, 2]))
     self.assertEqual(outputs, [1, 2])
Example #5
0
 def test_list_and_tuple(self):
     outputs = list(all_together([1, 2], (3, 4)))
     expected = [1, 2, 3, 4]
     self.assertEqual(outputs, expected)