示例#1
0
 def test_no_shorten(self):
     """
     Does not shorten when required length is greated
     """
     self.assertEqual(shorten('manish is bad boy', 32), 'manish is bad boy')
示例#2
0
 def test_shorten_equal(self):
     """
     Does not shorten when required length is equal
     """
     s = 'manish is bad boy'
     self.assertEqual(shorten(s, len(s)), s)
示例#3
0
 def test_shortens(self):
     """
     shortens the string to required length
     """
     self.assertEqual(shorten('manish is bad boy', 12), 'manish is...')