Ejemplo n.º 1
0
 def test_from_callable_cpu_bound(self, f):
     assert effect.from_callable(effect.cpu_bound(f)
                                 ).run(None) == f(None).get
Ejemplo n.º 2
0
 def test_catch_cpu_bound(self, f):
     assert effect.catch(Exception)(effect.cpu_bound(f)
                                    )(None).run(None) == f(None)
Ejemplo n.º 3
0
 def test_lift_cpu_bound(self, e1, e2):
     effect.lift(effect.cpu_bound(lambda v1, v2: (v1, v2))
                 )(e1, e2).run(None) == (e1.run(None), e2.run(None))
Ejemplo n.º 4
0
 def test_combine_cpu_bound(self, e1, e2):
     effect.combine(e1, e2)(effect.cpu_bound(lambda v1, v2: (v1, v2))
                            ).run(None) == (e1.run(None), e2.run(None))
Ejemplo n.º 5
0
 def test_map_cpu_bound(self, e, value):
     e.map(effect.cpu_bound(lambda _: value)).run(None) == value
Ejemplo n.º 6
0
 def test_recover_cpu_bound(self, e):
     effect.error('').recover(effect.cpu_bound(lambda _: e)
                              ).run(None) == e.run(None)
Ejemplo n.º 7
0
 def test_and_then_cpu_bound(self, e1, e2):
     e1.and_then(effect.cpu_bound(lambda _: e2)).run(None) == e2.run(None)