예제 #1
0
def test_return_false_with_future_result_container():  # noqa: WPS118
    """Ensures `is_io` function will return False for FutureResult."""
    assert is_io(FutureResult.from_failure('failure')) is False
예제 #2
0
async def test_return_true_with_awaited_future_result_container(
):  # noqa: E501,WPS118
    """Ensures `is_io` function will return False for FutureResult."""
    assert is_io(await FutureResult.from_failure('failure')) is True
예제 #3
0
def test_return_false_with_future_container():
    """Ensures `is_io` function will return False for Future."""
    assert is_io(Future.from_value('future')) is False
예제 #4
0
async def test_return_true_with_awaited_future_container():  # noqa: WPS118
    """Ensures `is_io` function will return False for Future."""
    assert is_io(await Future.from_value('future')) is True
예제 #5
0
def test_return_false_with_result_container():
    """Ensures `is_io` function will return False for Result."""
    assert is_io(Result.from_failure('failure')) is False
예제 #6
0
def test_return_false_with_requires_context_result_container():  # noqa: WPS118
    """Ensures `is_io` function will return False for RequiresContextResult."""
    assert is_io(RequiresContextResult.from_success(Success(True))) is False
예제 #7
0
def test_return_false_with_requires_context_container():  # noqa: WPS118
    """Ensures `is_io` function will return False for RequiresContext."""
    assert is_io(RequiresContext.empty) is False
예제 #8
0
def test_return_false_with_maybe_container():
    """Ensures `is_io` function will return False for Maybe."""
    assert is_io(Maybe.from_value(None)) is False
예제 #9
0
def test_return_true_with_requires_context_io_result_container(
):  # noqa: E501,WPS118
    """Ensures `is_io` function will return True for RequiresContextIOResult."""
    assert is_io(RequiresContextIOResult.from_success(1.5)) is True
예제 #10
0
def test_return_true_with_io_result_container():
    """Ensures `is_io` function will return True for IOResult."""
    assert is_io(IOResult(Success(10))) is True
예제 #11
0
def test_return_true_with_io_container():
    """Ensures `is_io` function will return True for IO."""
    assert is_io(IO(1.0)) is True