diff options
| author | Val Neekman <val@neekware.com> | 2012-10-14 19:21:46 -0700 |
|---|---|---|
| committer | Val Neekman <val@neekware.com> | 2012-10-14 19:21:46 -0700 |
| commit | 19587b7674691f059c5058fdbb858284afea0e4b (patch) | |
| tree | 0dbab9f02e9fa19c6cc6face5e9c21205170cb3a | |
| parent | cce2c8edd87a9ac130c1e41b06959e77f71042ba (diff) | |
| download | python-slugify-0.0.2.tar.gz | |
added more test cases0.0.2
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | slugify/__init__.py | 2 | ||||
| -rw-r--r-- | test.py | 14 |
3 files changed, 18 insertions, 6 deletions
@@ -43,6 +43,10 @@ How to use r = slugify(s) print r # => "ying-shi-ma" + txt = 'Компьютер' + r = slugify(txt) + print r # => "kompiuter" + Running the tests ================= @@ -54,6 +58,10 @@ To run the tests against the current environment: Changelog ========= +0.0.2 +----- +* Added more tests + 0.0.1 ----- diff --git a/slugify/__init__.py b/slugify/__init__.py index 94d0bc1..fe634bf 100644 --- a/slugify/__init__.py +++ b/slugify/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -__version__ = '0.0.1' +__version__ = '0.0.2' __all__ = ['slugify'] @@ -5,12 +5,16 @@ from slugify import slugify class TestSequenceFunctions(unittest.TestCase): - def test_space_dash(self): + def test_manager(self): + txt = "This is a test ---" r = slugify(txt) self.assertEquals(r, "this-is-a-test") - - def test_special_chars(self): + + txt = "This -- is a ## test ---" + r = slugify(txt) + self.assertEquals(r, "this-is-a-test") + txt = 'C\'est déjà l\'été.' r = slugify(txt) self.assertEquals(r, "cest-deja-lete") @@ -19,9 +23,9 @@ class TestSequenceFunctions(unittest.TestCase): r = slugify(txt) self.assertEquals(r, "nin-hao-wo-shi-zhong-guo-ren") - txt = '影師嗎' + txt = 'Компьютер' r = slugify(txt) - self.assertEquals(r, "ying-shi-ma") + self.assertEquals(r, "kompiuter") if __name__ == '__main__': unittest.main() |
