You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blog/test/test_truncate.py

10 lines
309 B
Python

import unittest
import makesite
class TruncateTest(unittest.TestCase):
def test_truncate(self):
long_text = ' \n'.join('word' + str(i) for i in range(50))
expected_text = ' '.join('word' + str(i) for i in range(25))
self.assertEqual(makesite.truncate(long_text), expected_text)