Esempio n. 1
0
 def test_complete(self):
     xform = xf.comp(xf.interpose('s'), xf.partition_all(2))
     self.assertEqual(list(xf.xiter(xform, [1, 2])), [(1, 's'), (2,)])
Esempio n. 2
0
 def test_arity_zero(self):
     self.assertEqual(xf.interpose('s')(lambda: 'success')(), 'success')
Esempio n. 3
0
 def test_interpose_empty(self):
     xform = xf.interpose('s')
     self.assertEqual(list(xf.xiter(xform, [])), [])
Esempio n. 4
0
 def test_reduced(self):
     xform = xf.comp(xf.interpose('s'), xf.take(4))
     self.assertEqual(list(xf.xiter(xform, [1, 2, 3])), [1, 's', 2, 's'])
Esempio n. 5
0
 def test_interpose_some(self):
     xform = xf.interpose('s')
     self.assertEqual(list(xf.xiter(xform, [1, 2, 3])), [1, 's', 2, 's', 3])