Skip to content

Commit

Permalink
Further Resolves Issue #325
Browse files Browse the repository at this point in the history
  • Loading branch information
derks committed Jul 13, 2015
1 parent 73d3905 commit f828ba0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/utils/misc_tests.py
Expand Up @@ -46,13 +46,25 @@ def test_wrap_str(self):
parts = new_text.split('\n')
self.eq(parts[2], '***ccccc')

def test_wrap_unicode(self):
text = u"aaaaa bbbbb ccccc"
new_text = misc.wrap(text, width=5)
parts = new_text.split('\n')
self.eq(len(parts), 3)
self.eq(parts[1], u'bbbbb')

new_text = misc.wrap(text, width=5, indent='***')
parts = new_text.split('\n')
self.eq(parts[2], u'***ccccc')

@test.raises(TypeError)
def test_wrap_int(self):
text = int('1' * 80)
try:
new_text = misc.wrap(text, width=5)
except TypeError as e:
self.eq(e.args[0], "`text` must be a string.")
self.eq(e.args[0],
"Argument `text` must be one of [str, unicode].")
raise

@test.raises(TypeError)
Expand All @@ -61,5 +73,6 @@ def test_wrap_none(self):
try:
new_text = misc.wrap(text, width=5)
except TypeError as e:
self.eq(e.args[0], "`text` must be a string.")
self.eq(e.args[0],
"Argument `text` must be one of [str, unicode].")
raise

0 comments on commit f828ba0

Please sign in to comment.