コード例 #1
0
 def test_zipup_5(self):
     # Make sure it works in the infinite case
     iterable = zz.zipup(zz.repeat(1), zz.repeat(2))
     self.assertEqual(iterable.take(2).list(), [(1, 2), (1, 2)])
コード例 #2
0
 def test_zipup_4(self):
     # Make sure it works given no arguments
     iterable = zz.zipup()
     self.assertEqual(iterable.list(), [])
コード例 #3
0
 def test_zipup_2(self):
     # Make sure it truncates on the right
     iterable = zz.zipup(["foo", "bar"], zz.repeat(1))
     self.assertEqual(iterable.list(), [("foo", 1), ("bar", 1)])
コード例 #4
0
 def test_zipup_3(self):
     # Make sure it truncates on the left
     iterable = zz.zipup(zz.repeat(1), ["foo", "bar"])
     self.assertEqual(iterable.list(), [(1, "foo"), (1, "bar")])
コード例 #5
0
 def test_zipup_1(self):
     iterable = zz.zipup([1, 2], ["A", "B"])
     self.assertEqual(iterable.list(), [(1, "A"), (2, "B")])