def test_not_truncate(self): string = "A" * 10 new_string = trunc(string, 20) self.assertEqual(len(new_string), 10)
def test_truncate(self): string = "A" * 10 new_string = trunc(string, 5) self.assertLess(len(new_string), 6)