Пример #1
0
def test__word_ladder_fuzz():
    with open('words5.dict') as f:
        words = f.readlines()
        words = list(set([word.strip() for word in words]))
    for i in range(1000000):
        word1 = random.choice(words)
        word2 = random.choice(words)
        res1 = _adjacent(word1, word2)
        res2 = _adjacent(word2, word1)
        assert res1 == res2 or res1 is res2
Пример #2
0
def test__word_ladder_2():
    assert not _adjacent('stone', 'stone1')
Пример #3
0
def test__word_ladder_1():
    assert not _adjacent('stone', 'money')
Пример #4
0
def test__word_ladder_5():
    assert _adjacent('stone', 'shone')
Пример #5
0
def test__word_ladder_4():
    assert _adjacent('stone', 'stony')
Пример #6
0
def test__word_ladder_1b():
    assert not _adjacent('money', 'stone')
Пример #7
0
def test__word_ladder_7b():
    assert not _adjacent('shone', '')
Пример #8
0
def test__word_ladder_7():
    assert not _adjacent('', 'shone')