コード例 #1
0
def test_compare_query_filters_with_equivalent_args_returns_true():
    query_filter1 = QueryFilter(EVENT_FILTER_FIELD_NAME, OPERATOR_STRING,
                                VALUE_STRING)
    query_filter2 = QueryFilter(EVENT_FILTER_FIELD_NAME, OPERATOR_STRING,
                                VALUE_STRING)
    assert query_filter1 == query_filter2
コード例 #2
0
):
    group1 = create_is_in_filter_group("term", ["value1", "value2", "value3"])
    group2 = create_is_in_filter_group("term", ["value3", "value1", "value2"])
    assert group1 == group2
    assert str(group1) == group2
    assert tuple(group1) == group2
    assert list(group1) == group2
    assert group1 == str(group2)
    assert group1 == tuple(group2)
    assert group1 == list(group2)


@pytest.mark.parametrize(
    "filter_class",
    [
        QueryFilter("term", "IS", "value1"),
        QueryFilter("term", "IS", "value2"),
        QueryFilter("term", "IS", "value3"),
    ],
)
def test_filter_group_contains_expected_query_filter_returns_true(
        filter_class):
    group = create_is_in_filter_group("term", ["value1", "value2", "value3"])
    assert filter_class in group
    assert str(filter_class) in group
    assert tuple(filter_class) in group
    assert list(filter_class) in group


@pytest.mark.parametrize(
    "filter_class",