def test_any_with_two_predicates(all_trials, trial_one, trial_two,
                                 trial_three):
    expected = [trial_one, trial_two, trial_three]

    results = q_filter_all(
        all_trials,
        q_any(q_item("survived").is_true(),
              q_item("date").contains("2003")))

    assert list(results) == expected
def test_not_with_any_and_two_predicates(all_trials, trial_four, trial_five):
    expected = [trial_four, trial_five]

    results = q_filter_all(
        all_trials,
        q_not(
            q_any(
                q_item("survived").is_true(),
                q_item("date").contains("2003"))))

    assert list(results) == expected
def test_not_with_any_and_three_predicates(all_trials, trial_one):
    expected = [trial_one]

    results = q_filter_all(
        all_trials,
        q_not(
            q_any(
                q_item("survived").is_false(),
                q_item("drug") == "tolterodine tartrate",
                q_item("dose_mg") > 350)))

    assert list(results) == expected
Exemplo n.º 4
0
def q_items_not_any(**kwargs) -> Callable:
    return q_not(q_any(*_kwarg_preds(kwargs, retrieve_item)))
Exemplo n.º 5
0
def q_attrs_not_any(**kwargs) -> Callable:
    return q_not(q_any(*_kwarg_preds(kwargs, retrieve_attr)))