예제 #1
0
파일: test_util.py 프로젝트: larryng/narwal
 def test_same_type(self):
     ok_(isinstance(limstr('hello world', 5), str))
     ok_(isinstance(limstr(u'hello world', 5), unicode))
예제 #2
0
파일: test_util.py 프로젝트: larryng/narwal
 def test_blanks(self):
     eq_(limstr('', 0), '')
     eq_(limstr('', 1), '')
예제 #3
0
파일: test_util.py 프로젝트: larryng/narwal
 def test_normal(self):
     s = 'hello world'
     eq_(limstr(s, 0), '')
     eq_(limstr(s, 5), 'he...')
     eq_(limstr(s, 11), 'hello world')
     eq_(limstr(s, 12), 'hello world')
예제 #4
0
파일: test_util.py 프로젝트: larryng/narwal
 def test_negative_max_length(self):
     limstr('', -1)