예제 #1
0
 def test_absolve(self):
     right = either.Right(1)
     left = either.Left('error')
     right_effect = effect.success(right)
     left_effect = effect.success(left)
     assert effect.absolve(right_effect).run(None) == 1
     with pytest.raises(Exception):
         # todo
         effect.absolve(left_effect).run(None)
예제 #2
0
 def test_absolve_repr(self):
     assert repr(effect.absolve(effect.success(0))) == 'absolve(success(0))'