Sha256: 865510bf2f65109b755f9019fccbbac8ca8be1b38f823b0da23afaf85ca9f887

Contents?: true

Size: 1.11 KB

Versions: 60

Compression:

Stored size: 1.11 KB

Contents

import unittest

from scrabble_score import score


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0

class WordTest(unittest.TestCase):
    def test_lowercase_letter(self):
        self.assertEqual(score("a"), 1)

    def test_uppercase_letter(self):
        self.assertEqual(score("A"), 1)

    def test_valuable_letter(self):
        self.assertEqual(score("f"), 4)

    def test_short_word(self):
        self.assertEqual(score("at"), 2)

    def test_short_valuable_word(self):
        self.assertEqual(score("zoo"), 12)

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

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

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

    def test_english_like_word(self):
        self.assertEqual(score("pinata"), 8)

    def test_empty_input(self):
        self.assertEqual(score(""), 0)

    def test_entire_alphabet_available(self):
        self.assertEqual(score("abcdefghijklmnopqrstuvwxyz"), 87)


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

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
trackler-2.2.1.105 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.104 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.103 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.102 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.101 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.100 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.99 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.98 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.97 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.96 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.95 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.94 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.93 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.92 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.91 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.90 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.89 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.88 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.87 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.86 tracks/python/exercises/scrabble-score/scrabble_score_test.py