def test_sorted():
    for n in range(1, 3):
        for conditions in (CONDITIONS_3, CONDITIONS_6):
            for sort in ('both', 'ascending', 'descending'):
                o = Sorted(n, order=sort)
                o.first_pass(conditions)
                yield check_sorted, o, len(conditions)

    for conditions in (CONDITIONS_2_2, CONDITIONS_2_3, CONDITIONS_2_3_2):
        with pytest.raises(ValueError):
            o = Sorted()
            o.first_pass(conditions)
Example #2
0
def test_sorted():
    for n in range(1, 3):
        for conditions in (CONDITIONS_3, CONDITIONS_6):
            for sort in ('both', 'ascending', 'descending'):
                o = Sorted(n, order=sort)
                o.first_pass(conditions)
                yield check_sorted, o, len(conditions)

    for conditions in (CONDITIONS_2_2, CONDITIONS_2_3, CONDITIONS_2_3_2):
        with pytest.raises(ValueError):
            o = Sorted()
            o.first_pass(conditions)
Example #3
0
def test_sorted_generator_condition():
    n = 2
    for sort in ('both', 'ascending', 'descending'):
        o = Sorted(n, order=sort)
        o.first_pass(c for c in CONDITIONS_3)
        yield check_sorted, o, len(CONDITIONS_3)
def test_sorted_generator_condition():
    n = 2
    for sort in ('both', 'ascending', 'descending'):
        o = Sorted(n, order=sort)
        o.first_pass(c for c in CONDITIONS_3)
        yield check_sorted, o, len(CONDITIONS_3)