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