예제 #1
0
 def test_from_callable_io_bound(self, f):
     assert effect.from_callable(effect.io_bound(f)
                                 ).run(None) == f(None).get
예제 #2
0
 def test_catch_io_bound(self, f):
     assert effect.catch(Exception)(effect.io_bound(f)
                                    )(None).run(None) == f(None)
예제 #3
0
 def test_lift_io_bound(self, e1, e2):
     effect.lift(effect.io_bound(lambda v1, v2: (v1, v2))
                 )(e1, e2).run(None) == (e1.run(None), e2.run(None))
예제 #4
0
 def test_combine_io_bound(self, e1, e2):
     effect.combine(e1, e2)(effect.io_bound(lambda v1, v2: (v1, v2))
                            ).run(None) == (e1.run(None), e2.run(None))
예제 #5
0
 def test_map_io_bound(self, e, value):
     e.map(effect.io_bound(lambda _: value)).run(None) == value
예제 #6
0
 def test_recover_io_bound(self, e):
     effect.error('').recover(effect.io_bound(lambda _: e)
                              ).run(None) == e.run(None)
예제 #7
0
 def test_and_then_io_bound(self, e1, e2):
     e1.and_then(effect.io_bound(lambda _: e2)).run(None) == e2.run(None)