Sha256: 7bb1f774a270bc00390a2c2f0d6ff98dc3b2ea99a8205e5a75d69c00ca09b9b6

Contents?: true

Size: 1.11 KB

Versions: 123

Compression:

Stored size: 1.11 KB

Contents

import unittest

from scrabble_score import score


# test cases adapted from `x-common//canonical-data.json` @ version: 1.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

123 entries across 123 versions & 1 rubygems

Version Path
trackler-2.2.1.45 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.44 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.43 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.42 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.41 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.40 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.39 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.38 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.37 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.36 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.35 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.34 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.33 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.32 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.31 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.30 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.29 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.28 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.27 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.26 tracks/python/exercises/scrabble-score/scrabble_score_test.py