示例#1
0
文件: maybe_spec.py 项目: tek/tryp.py
 def product_n(self):
     m = Just(1).product3(Just(2), Just(3), Just(4))
     m.flat_map4(lambda a, b, c, d: Just(b + d)).should.contain(6)
     e = Just(1).product3(Just(2), Empty(), Just(4))
     e.should.be.empty
示例#2
0
文件: maybe_spec.py 项目: tek/tryp.py
 def flat_map_n(self):
     m = Just((1, 2, 3, 4))
     m.flat_map4(lambda a, b, c, d: Just(b + d)).should.contain(6)
     m.flat_map5.when.called_with(lambda a: a).should.throw(TypeError)