示例#1
0
def test_duplicate_tweet_scores():
    tweet = "A FINISHED tweet looks like this"
    tweet_reply = None
    words = hp.reader(tweet)
    scores = hp.scrabble_scores(words)
    assert hp.write_reply(words, scores) == tweet_reply
    for w in words:
        hp.remove_word_from_log(w.lower())
示例#2
0
def test_tweet_writer_score_integration():
    tweet = "A HAGGARD tweet looks like this"
    tweet_reply = "Nice word, @HaggardHawks; HAGGARD is worth A BINGO! 63pts in Scrabble!"
    words = hp.reader(tweet)
    scores = hp.scrabble_scores(words)
    assert hp.write_reply(words, scores) == tweet_reply
    for w in words:
        hp.remove_word_from_log(w.lower())
示例#3
0
def test_tweet_writer_null_word():
    tweet = "A non-haggard tweet looks like this"
    tweet_reply = None
    words = hp.reader(tweet)
    scores = hp.scrabble_scores(words)
    assert hp.write_reply(words, scores) == tweet_reply
    for w in words:
        hp.remove_word_from_log(w.lower())
示例#4
0
def test_tweet_writer_score_integration_multi_word():
    tweet = "A GIROUETTE is a weathercock. GIROUETTISM is a constant changing of opinions."
    tweet_reply = "Nice word, @HaggardHawks; GIROUETTE is worth A BINGO! 60pts, and GIROUETTISM is worth A BINGO! 64pts in Scrabble!"
    words = hp.reader(tweet)
    scores = hp.scrabble_scores(words)
    assert hp.write_reply(words, scores) == tweet_reply
    for w in words:
        hp.remove_word_from_log(w.lower())
示例#5
0
def test_hyphen_tweet():
    tweet = "A CLEVER-CLUMSY is someone who makes a mess of something they were keen to do.(AE Baker, Northamptonshire Wordss & Phrases, 1854)"
    scores = ["A BINGO! 74"]
    assert hp.scrabble_scores(hp.reader(tweet)) == scores
示例#6
0
def test_original_lake_tweet():
    tweet = "There is a lake in Massachusetts called CHARGOGGAGOGGMANCHAUGGAUGGAGOGGCHAUBUNAGUNGAMAUGG."
    scores = ["A BINGO! 137"]
    assert hp.scrabble_scores(hp.reader(tweet)) == scores
示例#7
0
def test_tweet_scores_with_specials():
    tweet = "A HAGGARD.# tweet looks like this"
    scores = ["A BINGO! 63"]
    assert hp.scrabble_scores(hp.reader(tweet)) == scores
示例#8
0
def test_bingo_tweet_scores():
    tweet = "A HAGGARD tweet looks like this"
    scores = ["A BINGO! 63"]
    assert hp.scrabble_scores(hp.reader(tweet)) == scores
示例#9
0
def test_null_tweet_scores():
    tweet = "A non-haggard tweet looks like this"
    scores = []
    assert hp.scrabble_scores(hp.reader(tweet)) == scores
示例#10
0
def test_reader():
    tweet = "A HAGGARD tweet looks like this"
    words = ["haggard"]
    assert hp.reader(tweet) == words
示例#11
0
def test_tweet_scores():
    tweet = "A HAGGY tweet looks like this"
    scores = ["13"]
    assert hp.scrabble_scores(hp.reader(tweet)) == scores