Exemplo n.º 1
0
 def test_repeat_items_0_times(self):
     '''Test repeat_items([1, 2, 3], 0)
     '''
     sequence = [1, 2, 3]
     expected = []
     self.assertEqual(list(source.repeat_items(sequence, 0)), expected)
Exemplo n.º 2
0
 def test_repeat_items_once(self):
     '''Test repeat_items([1, 2, 3], 1)
     '''
     sequence = [1, 2, 3]
     expected = sequence
     self.assertEqual(list(source.repeat_items(sequence, 1)), expected)
Exemplo n.º 3
0
 def test_repeat_items_empty_list(self):
     '''Test repeat_items([])
     '''
     sequence = expected = []
     self.assertEqual(list(source.repeat_items(sequence)), expected)
Exemplo n.º 4
0
 def test_repeat_items_single_item(self):
     '''Test repeat_items([1])
     '''
     sequence = [1]
     expected = [1, 1]
     self.assertEqual(list(source.repeat_items(sequence)), expected)
Exemplo n.º 5
0
 def test_repeat_items(self):
     '''Test repeat_items([1, 2, 3])
     '''
     sequence = [1, 2, 3]
     expected = [1, 1, 2, 2, 3, 3]
     self.assertEqual(list(source.repeat_items(sequence)), expected)