Exemplo n.º 1
0
def test_basic(pair: AlternativeNativeSetsPair) -> None:
    alternative, native = pair

    alternative_result, native_result = alternative.clear(), native.clear()

    assert alternative_result is native_result is None
    assert are_alternative_native_sets_equal(alternative, native)
Exemplo n.º 2
0
def test_basic(pair: AlternativeNativeSetsPair,
               others: List[List[Any]]) -> None:
    alternative, native = pair

    alternative_result, native_result = (alternative.intersection(*others),
                                         native.intersection(*others))

    assert are_alternative_native_sets_equal(alternative_result, native_result)
Exemplo n.º 3
0
def test_basic(pair: AlternativeNativeSetsPair, value: Any) -> None:
    alternative, native = pair

    alternative_result = alternative.discard(value)
    native_result = native.discard(value)

    assert alternative_result is native_result is None
    assert are_alternative_native_sets_equal(alternative, native)
def test_basic(pair: AlternativeNativeSetsPair, other: List[Any]) -> None:
    alternative, native = pair

    alternative_result, native_result = (
        alternative.symmetric_difference(other),
        native.symmetric_difference(other))

    assert are_alternative_native_sets_equal(alternative_result, native_result)
Exemplo n.º 5
0
def test_basic(pair: AlternativeNativeSetsPair) -> None:
    alternative, native = pair

    alternative_result = alternative.copy()
    native_result = native.copy()

    assert are_alternative_native_sets_equal(alternative_result,
                                             native_result)
Exemplo n.º 6
0
def test_basic(first_pair: AlternativeNativeSetsPair,
               second_pair: AlternativeNativeSetsPair) -> None:
    alternative_first, native_first = first_pair
    alternative_second, native_second = second_pair

    alternative_first |= alternative_second
    native_first |= native_second

    assert are_alternative_native_sets_equal(alternative_first, native_first)
Exemplo n.º 7
0
def test_basic(pair: AlternativeNativeSetsPair,
               others: List[List[Any]]) -> None:
    alternative, native = pair

    alternative_result, native_result = (alternative.update(*others),
                                         native.update(*others))

    assert alternative_result is native_result is None
    assert are_alternative_native_sets_equal(alternative, native)
Exemplo n.º 8
0
def test_basic(pair_with_value: Tuple[AlternativeNativeSetsPair, Any]
               ) -> None:
    (alternative, native), value = pair_with_value

    alternative_result, native_result = (alternative.remove(value),
                                         native.remove(value))

    assert alternative_result is native_result is None
    assert are_alternative_native_sets_equal(alternative, native)
def test_basic(objects: List[Any]) -> None:
    alternative, native = AlternativeSet(objects), NativeSet(objects)

    assert are_alternative_native_sets_equal(alternative, native)
Exemplo n.º 10
0
def test_basic(pair: AlternativeNativeSetsPair) -> None:
    alternative, native = pair

    assert are_alternative_native_sets_equal(pickle_round_trip(alternative),
                                             pickle_round_trip(native))