Пример #1
0
 def test_tail(self):
     self.assertEqual(truncated_string('hello world', 6, tail='foobar'), 'hellofoobar')
Пример #2
0
 def test_shorter_than_cutoff(self):
     self.assertEqual(truncated_string('hello world', 10000), 'hello world')
Пример #3
0
 def test_cutoff_is_none(self):
     self.assertEqual(truncated_string('hello world', None), 'hello world')
Пример #4
0
 def test_truncated(self):
     self.assertEqual(truncated_string('hello world', 6), 'hello...')