Sha256: 7f36e9c1a7e762240e76da42dc26bca9a4fc263c460cf8b80148f17a286c4c94

Contents?: true

Size: 1.35 KB

Versions: 107

Compression:

Stored size: 1.35 KB

Contents

import unittest

from isogram import is_isogram


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

class TestIsogram(unittest.TestCase):

    def test_empty_string(self):
        self.assertIs(is_isogram(""), True)

    def test_isogram_with_only_lower_case_characters(self):
        self.assertIs(is_isogram("isogram"), True)

    def test_word_with_one_duplicated_character(self):
        self.assertIs(is_isogram("eleven"), False)

    def test_longest_reported_english_isogram(self):
        self.assertIs(is_isogram("subdermatoglyphic"), True)

    def test_word_with_duplicated_character_in_mixed_case(self):
        self.assertIs(is_isogram("Alphabet"), False)

    def test_hypothetical_isogrammic_word_with_hyphen(self):
        self.assertIs(is_isogram("thumbscrew-japingly"), True)

    def test_isogram_with_duplicated_hyphen(self):
        self.assertIs(is_isogram("six-year-old"), True)

    def test_made_up_name_that_is_an_isogram(self):
        self.assertIs(is_isogram("Emily Jung Schwartzkopf"), True)

    def test_duplicated_character_in_the_middle(self):
        self.assertIs(is_isogram("accentor"), False)

    # Additional tests for this track

    def test_isogram_with_duplicated_letter_and_nonletter_character(self):
        self.assertIs(is_isogram("Aleph Bot Chap"), False)


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

Version data entries

107 entries across 107 versions & 1 rubygems

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