Sha256: f904ff462f10712737198562d60b3ad798c0a4005e90ad0cc6a412c64085f6e4

Contents?: true

Size: 1.12 KB

Versions: 19

Compression:

Stored size: 1.12 KB

Contents

import unittest

from scrabble_score import score


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

class ScrabbleScoreTest(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

19 entries across 19 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.179 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.178 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.177 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.176 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.175 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.174 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.173 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.172 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.171 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.170 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.169 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.167 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.166 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.165 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.164 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.163 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.162 tracks/python/exercises/scrabble-score/scrabble_score_test.py
trackler-2.2.1.161 tracks/python/exercises/scrabble-score/scrabble_score_test.py