コード例 #1
0
def test_word_combinations_3():
    combos = Pattern.word_combinations(have=4, placeholders=3)
    assert list(combos) == [
        (2, 1, 1),
        (1, 2, 1),
        (1, 1, 2)
    ]
コード例 #2
0
def test_word_combinations_2():
    combos = Pattern.word_combinations(have=4, placeholders=2)
    assert list(combos) == [
        (3, 1),
        (2, 2),
        (1, 3)
    ]
コード例 #3
0
def test_word_combinations_4():
    combos = Pattern.word_combinations(have=5, placeholders=3)
    assert list(combos) == [
        (3, 1, 1),
        (2, 2, 1),
        (2, 1, 2),
        (1, 3, 1),
        (1, 2, 2),
        (1, 1, 3),
    ]