Further Resolves Issue #325

This commit is contained in:
BJ Dierkes 2015-07-13 14:42:09 -05:00
parent 73d3905fed
commit f828ba065f

View File

@ -46,13 +46,25 @@ class BackendTestCase(test.CementCoreTestCase):
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)
@ -61,5 +73,6 @@ class BackendTestCase(test.CementCoreTestCase):
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