diff options
author | Sunaina Pai <sunainapai.in@gmail.com> | 2018-08-11 14:40:18 +0530 |
---|---|---|
committer | Sunaina Pai <sunainapai.in@gmail.com> | 2018-08-11 14:40:18 +0530 |
commit | 8195677cae913e2f964bf631d88f00a33e16bc24 (patch) | |
tree | 3dddc9320f46c48e7b5e43bbbe4fb765b75b4e9b /test/test_truncate.py | |
parent | 020ab349067939a121f8b75f003501a7e00198c6 (diff) |
Populate placeholders in content when specified
Placeholders in content files are not populated by default. If
placeholders are to be populated in content files, parameter named
`render` with a string value of `yes` must be specified.
This `render` parameter may be specified as a header in content files or
it may be specified as a keyword argument in `make_pages` call.
Diffstat (limited to 'test/test_truncate.py')
-rw-r--r-- | test/test_truncate.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_truncate.py b/test/test_truncate.py new file mode 100644 index 0000000..3486d71 --- /dev/null +++ b/test/test_truncate.py @@ -0,0 +1,9 @@ +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) |