Beispiel #1
0
 def test_max_word_length(self):
     longest_word_english = 'pneumonoultramicroscopicsilicovolcanoconiosis'
     pyramid = word_pyramid.make_word_pyramid(longest_word_english)
     with pytest.raises(AssertionError) as e:
         pyramid = word_pyramid.make_word_pyramid(longest_word_english +
                                                  'a')
     assert e.value.args[
         0] == 'Your word must be less than 45 characters, but was 46'
Beispiel #2
0
 def test_counter_uppercase_letter(self):
     pyramid = word_pyramid.make_word_pyramid('SkipPeR')
     assert pyramid == Counter({
         's': 1,
         'k': 1,
         'i': 1,
         'e': 1,
         'r': 1,
         'p': 2
     })
Beispiel #3
0
 def test_counter_space(self):
     pyramid = word_pyramid.make_word_pyramid('hi there')
     assert pyramid == Counter({
         'i': 1,
         ' ': 1,
         't': 1,
         'r': 1,
         'h': 2,
         'e': 2
     })
Beispiel #4
0
 def test_counter_hyphen(self):
     pyramid = word_pyramid.make_word_pyramid('skip-it')
     assert pyramid == Counter({
         's': 1,
         'k': 1,
         'p': 1,
         '-': 1,
         't': 1,
         'i': 2
     })
Beispiel #5
0
 def test_input_integers(self):
     pyramid = word_pyramid.make_word_pyramid('1223334444')
     assert pyramid == Counter({'1': 1, '2': 2, '3': 3, '4': 4})
Beispiel #6
0
 def test_counter_unicode(self):
     pyramid = word_pyramid.make_word_pyramid('☂')
     assert pyramid == Counter({'☂': 1})
Beispiel #7
0
 def test_counter_bandana(self):
     pyramid = word_pyramid.make_word_pyramid('bandana')
     assert pyramid == Counter({'b': 1, 'd': 1, 'n': 2, 'a': 3})