コード例 #1
0
def test_last_word_blank():
    with pytest.raises(ValueError):
        utils.last_word("")
コード例 #2
0
def test_last_word_lowercase():
    word = utils.last_word("This is an example sentence")

    assert word == "sentence"
コード例 #3
0
def test_last_word_casing():
    word = utils.last_word("TESTING ALL CAPS!!!")

    assert word == "CAPS"
コード例 #4
0
def test_last_word_blank():
    with pytest.raises(ValueError):
        utils.last_word("")
コード例 #5
0
def test_last_word_punctuation():
    word = utils.last_word("punctuation.")

    assert word == "punctuation"
コード例 #6
0
def test_last_word_casing():
    word = utils.last_word("TESTING ALL CAPS!!!")

    assert word == "CAPS"
コード例 #7
0
def test_last_word_lowercase():
    word = utils.last_word("This is an example sentence")

    assert word == "sentence"
コード例 #8
0
def test_last_word_punctuation():
    word = utils.last_word("punctuation.")

    assert word == "punctuation"
コード例 #9
0
ファイル: rhymes.py プロジェクト: kevin-brown/rhyme-detect
def line_similarity(first_line, second_line):
    first_compare = last_word(first_line)
    second_compare = last_word(second_line)

    return word_similarity(first_compare, second_compare)
コード例 #10
0
def line_similarity(first_line, second_line):
    first_compare = last_word(first_line)
    second_compare = last_word(second_line)

    return word_similarity(first_compare, second_compare)