Sha256: 49952f773825cdf39cba494e069482068a5ce69c3c1c6edf5701458585129136

Contents?: true

Size: 1.11 KB

Versions: 54

Compression:

Stored size: 1.11 KB

Contents

import unittest

from scrabble_score import score


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.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

54 entries across 54 versions & 1 rubygems

Version Path
trackler-2.2.1.160 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.159 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.158 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.157 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.156 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.155 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.154 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.153 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.152 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.151 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.150 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.149 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.148 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.147 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.146 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.145 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.144 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.143 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.142 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.141 tracks/python/exercises/scrabble-score/scrabble_score_test.py