Sha256: eaa46cac9d7e2d825a9820fcacb5846875bd365e2ff84a1c57cee22f570e1300

Contents?: true

Size: 833 Bytes

Versions: 101

Compression:

Stored size: 833 Bytes

Contents

import unittest

from scrabble_score import score


class WordTest(unittest.TestCase):
    def test_invalid_word_scores_zero(self):
        self.assertEqual(0, score(''))
        self.assertEqual(0, score(' \t\n'))
        self.assertEqual(0, score('hous3'))
        self.assertEqual(0, score('wo rd'))

    def test_scores_very_short_word(self):
        self.assertEqual(1, score('a'))

    def test_scores_other_very_short_word(self):
        self.assertEqual(4, score('f'))

    def test_simple_word_scores_the_number_of_letters(self):
        self.assertEqual(6, score("street"))

    def test_complicated_word_scores_more(self):
        self.assertEqual(22, score("quirky"))

    def test_scores_are_case_insensitive(self):
        self.assertEqual(41, score("OxyphenButazone"))


if __name__ == '__main__':
    unittest.main()

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
trackler-2.0.8.27 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.26 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.24 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.23 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.22 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.21 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.20 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.19 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.18 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.17 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.16 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.15 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.14 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.13 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.12 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.11 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.10 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.9 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.8 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.0.8.7 tracks/python/exercises/scrabble-score/scrabble_score_test.py