-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_hyphenate.py
32 lines (25 loc) · 1.05 KB
/
test_hyphenate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# test_hyphenate.py - unit tests for Hyphenate
#
# This file is part of Hyphenate. The authors of Hyphenate abandon all
# claims to copyright, and dedicate it to the public domain.
"""Unit tests for hyphenating words."""
from unittest import TestCase
from hyphenate import hyphenate_word
class TestHyphenation(TestCase):
def test_short_word(self):
computed = hyphenate_word('the')
expected = ['the']
self.assertEqual(computed, expected)
def test_medium_word(self):
computed = hyphenate_word('hyphenation')
expected = ['hy', 'phen', 'ation']
self.assertEqual(computed, expected)
def test_long_word(self):
computed = hyphenate_word('supercalifragilisticexpialidocious')
expected = ['su', 'per', 'cal', 'ifrag', 'ilis', 'tic', 'ex', 'pi',
'ali', 'do', 'cious']
self.assertEqual(computed, expected)
def test_exception_word(self):
computed = hyphenate_word('associate')
expected = ['as', 'so', 'ciate']
self.assertEqual(computed, expected)