From 7699d5a67a33239308a83f5dc4669f714af4123a Mon Sep 17 00:00:00 2001 From: Val Neekman Date: Fri, 26 Aug 2016 11:29:43 -0400 Subject: add more tests --- test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test.py') 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() -- cgit v1.2.1