def test_combine_with_error(self): result_list = [ Result.Ok("a", True), Result.Ok("b", True), Result.Fail("c"), ] result = Result.combine(result_list) assert not result.success
def test_combine_without_error(self): result_list = [ Result.Ok("a", True), Result.Ok("b", True), Result.Ok("c", False), ] result = Result.combine(result_list) assert result.success
def test_combine_without_error_list_result(self): result_list = [ Result.Ok("a", True), Result.Ok("b", True), Result.Ok(["c", "d"], False), ] result = Result.combine(result_list) assert result.success assert result.value == ["a", "b", "c", "d"]