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'
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 })
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 })
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 })
def test_input_integers(self): pyramid = word_pyramid.make_word_pyramid('1223334444') assert pyramid == Counter({'1': 1, '2': 2, '3': 3, '4': 4})
def test_counter_unicode(self): pyramid = word_pyramid.make_word_pyramid('☂') assert pyramid == Counter({'☂': 1})
def test_counter_bandana(self): pyramid = word_pyramid.make_word_pyramid('bandana') assert pyramid == Counter({'b': 1, 'd': 1, 'n': 2, 'a': 3})