Example #1
0
 def test_izip_first_longer(self):
     '''Test izip([1, 2, 3, 4, 5], ['a', 'b', 'c'])
     '''
     sequence_1 = [1, 2, 3, 4, 5]
     sequence_2 = ['a', 'b', 'c']
     expected = [[1, 'a'], [2, 'b'], [3, 'c']]
     self.assertEqual(list(source.izip(sequence_1, sequence_2)), expected)
Example #2
0
 def test_izip_empty_sequences(self):
     '''Test izip([1, 2, 3], [], [])
     '''
     sequence_1 = [1, 2, 3]
     sequence_2 = sequence_3 = expected = []
     self.assertEqual(list(source.izip(sequence_1, sequence_2, sequence_3)),
                      expected)
Example #3
0
 def test_izip_3_sequences(self):
     '''Test izip([1, 2, 3, 4, 5], ['a', 'b', 'c'], [None, True, False])
     '''
     sequence_1 = [1, 2, 3, 4, 5]
     sequence_2 = ['a', 'b', 'c']
     sequence_3 = [None, True, False]
     expected = [[1, 'a', None], [2, 'b', True], [3, 'c', False]]
     self.assertEqual(list(source.izip(sequence_1, sequence_2, sequence_3)),
                      expected)
Example #4
0
 def test_izip_no_sequences(self):
     '''Test izip([1, 2, 3, 4, 5], ['a', 'b', 'c'])
     '''
     expected = []
     self.assertEqual(list(source.izip()), expected)