summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authordioexul <dioexul@gmail.com>2015-02-21 19:17:40 +0300
committerdioexul <dioexul@gmail.com>2015-02-21 19:17:40 +0300
commit07155c2001580b0ec70b40f24a475baef6238aac (patch)
tree4d291123301f3b252ffa7fe93bb53cd7fb84e494 /test.py
parent3d75734751b36ae14feab0d84f5d670f1d6225e3 (diff)
downloadpython-slugify-07155c2001580b0ec70b40f24a475baef6238aac.tar.gz
Fix bug (len of output string).
Diffstat (limited to 'test.py')
-rw-r--r--test.py30
1 files changed, 13 insertions, 17 deletions
diff --git a/test.py b/test.py
index 90ad251..b1d4ca9 100644
--- a/test.py
+++ b/test.py
@@ -53,6 +53,18 @@ class TestSequenceFunctions(unittest.TestCase):
self.assertEqual(r, "jaja-lol-a")
txt = 'jaja---lol-méméméoo--a'
+ r = slugify(txt, max_length=17, word_boundary=True)
+ self.assertEqual(r, "jaja-lol-mememeoo")
+
+ txt = 'jaja---lol-méméméoo--a'
+ r = slugify(txt, max_length=18, word_boundary=True)
+ self.assertEqual(r, "jaja-lol-mememeoo")
+
+ txt = 'jaja---lol-méméméoo--a'
+ r = slugify(txt, max_length=19, word_boundary=True)
+ self.assertEqual(r, "jaja-lol-mememeoo-a")
+
+ txt = 'jaja---lol-méméméoo--a'
r = slugify(txt, max_length=20, word_boundary=True, separator=".")
self.assertEqual(r, "jaja.lol.mememeoo.a")
@@ -68,21 +80,5 @@ class TestSequenceFunctions(unittest.TestCase):
r = slugify(txt)
self.assertEqual(r, "this-is-a-test")
- txt = 'Тестирование полных слов без замены'
- r = slugify(txt, max_length=20, word_boundary=True, save_order=False)
- self.assertEqual(r, "testirovanie-polnykh")
-
- txt = 'Тестирование полных слов без замены'
- r = slugify(txt, max_length=19, word_boundary=True, save_order=False)
- self.assertEqual(r, "testirovanie-slov")
-
- txt = 'Тестирование полных слов без замены'
- r = slugify(txt, max_length=20, word_boundary=True, save_order=True)
- self.assertEqual(r, "testirovanie-polnykh")
-
- txt = 'Тестирование полных слов без замены'
- r = slugify(txt, max_length=19, word_boundary=True, save_order=True)
- self.assertEqual(r, "testirovanie")
-
if __name__ == '__main__':
- unittest.main()
+ unittest.main() \ No newline at end of file