diff options
| author | Val Neekman <val@neekware.com> | 2016-08-26 11:58:56 -0400 |
|---|---|---|
| committer | Val Neekman <val@neekware.com> | 2016-08-26 11:58:56 -0400 |
| commit | 6472f8fae4088f323a69ef5086f0f97268be88f8 (patch) | |
| tree | eb61dadaf4a7c91efcfe6463851efd7e46424bb9 /test.py | |
| parent | 66146885159df3cf24e9ebe32aa288b9900ea052 (diff) | |
| download | python-slugify-1.2.1.tar.gz | |
add py3.5 support, add manifest.in file, add more tests1.2.1
Diffstat (limited to 'test.py')
| -rw-r--r-- | test.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -2,6 +2,7 @@ import unittest from slugify import slugify +from slugify import smart_truncate class TestSlugification(unittest.TestCase): @@ -167,5 +168,17 @@ class TestSlugification(unittest.TestCase): self.assertEqual(r, '1000-reasons-you-are-1') +class TestUtils(unittest.TestCase): + + def test_smart_truncate_no_max_length(self): + txt = '1,000 reasons you are #1' + r = smart_truncate(txt) + self.assertEqual(r, txt) + + def test_smart_truncate_no_seperator(self): + txt = '1,000 reasons you are #1' + r = smart_truncate(txt, max_length=100, separator='_') + self.assertEqual(r, txt) + if __name__ == '__main__': unittest.main() |
