<gh_stars>0
"""Test for contains_all_from() in comparitors.py."""
from copy import deepcopy
from typing import Any
from typing import Iterable
from eepythontools.collection_tools import contains_all_from
from eepythontools.hypothesis_tools import anything
from hypothesis import given, assume, strategies as st


@given(
    x_operand=anything(),
    y_operand=anything(),
    first_item_must_match=st.booleans(),
)
def test_no_match_contains_all_from(
    x_operand: Any,
    y_operand: Any,
    first_item_must_match: bool,
) -> None:
    assume(x_operand is not y_operand)
    assume(x_operand != y_operand)
    if isinstance(x_operand, Iterable) and isinstance(y_operand, Iterable):
        assume(list(x_operand) != list(y_operand))
    print("No Match: x: ", x_operand, " y: ", y_operand)
    assert not contains_all_from(
        x_operand=x_operand,
        y_operand=y_operand,
        first_item_must_match=first_item_must_match,
        max_nesting_depth=100,
    )


@given(
    x_operand=anything(),
    first_item_must_match=st.booleans(),
)
def test_match_contains_all_from(
    x_operand: Any,
    first_item_must_match: bool,
) -> None:
    y_operand = deepcopy(x_operand)
    assert contains_all_from(
        x_operand=x_operand,
        y_operand=y_operand,
        first_item_must_match=first_item_must_match,
        max_nesting_depth=100,
    )

"""Test for contains_all_from() in comparitors.py."""
from copy import deepcopy
from typing import Any
from typing import Iterable
from eepythontools.collection_tools import contains_all_from
from eepythontools.hypothesis_tools import anything
from hypothesis import given, assume, strategies as st


@given(
    x_operand=anything(),
    y_operand=anything(),
    first_item_must_match=st.booleans(),
)
def test_no_match_contains_all_from(
    x_operand: Any,
    y_operand: Any,
    first_item_must_match: bool,
) -> None:
    assume(x_operand is not y_operand)
    assume(x_operand != y_operand)
    if isinstance(x_operand, Iterable) and isinstance(y_operand, Iterable):
        assume(list(x_operand) != list(y_operand))
    print("No Match: x: ", x_operand, " y: ", y_operand)
    assert not contains_all_from(
        x_operand=x_operand,
        y_operand=y_operand,
        first_item_must_match=first_item_must_match,
        max_nesting_depth=100,
    )


@given(
    x_operand=anything(),
    first_item_must_match=st.booleans(),
)
def test_match_contains_all_from(
    x_operand: Any,
    first_item_must_match: bool,
) -> None:
    y_operand = deepcopy(x_operand)
    assert contains_all_from(
        x_operand=x_operand,
        y_operand=y_operand,
        first_item_must_match=first_item_must_match,
        max_nesting_depth=100,
    )
Test for contains_all_from() in comparitors.py.