def test_tail(self): self.assertEqual(truncated_string('hello world', 6, tail='foobar'), 'hellofoobar')
def test_shorter_than_cutoff(self): self.assertEqual(truncated_string('hello world', 10000), 'hello world')
def test_cutoff_is_none(self): self.assertEqual(truncated_string('hello world', None), 'hello world')
def test_truncated(self): self.assertEqual(truncated_string('hello world', 6), 'hello...')