Guest User

test class

a guest
Dec 13th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.39 KB | None | 0 0
  1. import unittest
  2.  
  3. from isogram import is_isogram
  4.  
  5.  
  6. # Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
  7.  
  8. class TestIsogram(unittest.TestCase):
  9.  
  10.     def test_empty_string(self):
  11.         self.assertIs(is_isogram(""), True)
  12.  
  13.     def test_isogram_with_only_lower_case_characters(self):
  14.         self.assertIs(is_isogram("isogram"), True)
  15.  
  16.     def test_word_with_one_duplicated_character(self):
  17.         self.assertIs(is_isogram("eleven"), False)
  18.  
  19.     def test_longest_reported_english_isogram(self):
  20.         self.assertIs(is_isogram("subdermatoglyphic"), True)
  21.  
  22.     def test_word_with_duplicated_character_in_mixed_case(self):
  23.         self.assertIs(is_isogram("Alphabet"), False)
  24.  
  25.     def test_hypothetical_isogrammic_word_with_hyphen(self):
  26.         self.assertIs(is_isogram("thumbscrew-japingly"), True)
  27.  
  28.     def test_isogram_with_duplicated_hyphen(self):
  29.         self.assertIs(is_isogram("six-year-old"), True)
  30.  
  31.     def test_made_up_name_that_is_an_isogram(self):
  32.         self.assertIs(is_isogram("Emily Jung Schwartzkopf"), True)
  33.  
  34.     def test_duplicated_character_in_the_middle(self):
  35.         self.assertIs(is_isogram("accentor"), False)
  36.  
  37.     # Additional tests for this track
  38.  
  39.     def test_isogram_with_duplicated_letter_and_nonletter_character(self):
  40.         self.assertIs(is_isogram("Aleph Bot Chap"), False)
  41.  
  42.  
  43. if __name__ == '__main__':
  44.     unittest.main()
Add Comment
Please, Sign In to add comment