def test_shuffle_generator_condition(): n = 3 o = Shuffle(number=n) o.first_pass(c for c in CONDITIONS_3) yield check_shuffle, o, len(CONDITIONS_3) o = Shuffle(n, avoid_repeats=True) o.first_pass(c for c in CONDITIONS_3) yield check_shuffle, o, len(CONDITIONS_3) yield check_repeats, o.get_order()
def test_shuffle(): for n in range(1, 6, 2): for conditions in (CONDITIONS_6, CONDITIONS_2_3, CONDITIONS_2_3_2): o = Shuffle(number=n) o.first_pass(conditions) yield check_shuffle, o, len(conditions) o = Shuffle(n, avoid_repeats=True) o.first_pass(conditions) yield check_shuffle, o, len(conditions) yield check_repeats, o.get_order()