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')
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)
def test_shortens(self): """ shortens the string to required length """ self.assertEqual(shorten('manish is bad boy', 12), 'manish is...')