summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
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()