summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorVal Neekman <val@neekware.com>2016-08-26 11:58:56 -0400
committerVal Neekman <val@neekware.com>2016-08-26 11:58:56 -0400
commit6472f8fae4088f323a69ef5086f0f97268be88f8 (patch)
treeeb61dadaf4a7c91efcfe6463851efd7e46424bb9 /test.py
parent66146885159df3cf24e9ebe32aa288b9900ea052 (diff)
downloadpython-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.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test.py b/test.py
index 5bad955..768fcb9 100644
--- a/test.py
+++ b/test.py
@@ -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()