Exemple #1
0
 def test_string(self):
     inputs = "hey"
     outputs = [('h', 'e'), ('e', 'y'), ('y', None)]
     self.assertEqual(list(pairwise(inputs)), outputs)
Exemple #2
0
 def test_none(self):
     inputs = [None, None]
     outputs = [(None, None), (None, None)]
     self.assertEqual(list(pairwise(inputs)), outputs)
Exemple #3
0
 def test_empty(self):
     self.assertEqual(list(pairwise([])), [])
Exemple #4
0
 def test_one_item(self):
     self.assertEqual(list(pairwise([1])), [(1, None)])
Exemple #5
0
 def test_three(self):
     inputs = [1, 2, 3]
     outputs = [(1, 2), (2, 3), (3, None)]
     self.assertEqual(list(pairwise(inputs)), outputs)