diff options
| author | Tomaz Solc <avian@toybox.zemanta.com> | 2008-09-05 16:51:19 +0200 |
|---|---|---|
| committer | Tomaz Solc <avian@toybox.zemanta.com> | 2008-09-05 16:51:19 +0200 |
| commit | b2cedd05e3ce012098c23fbb263dc382ac45a302 (patch) | |
| tree | 9b95fa5a01a64e0cab8c34f8ea4744f786eb0875 /tests | |
| download | unidecode-b2cedd05e3ce012098c23fbb263dc382ac45a302.tar.gz | |
Initial import.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/__init__.py | 0 | ||||
| -rw-r--r-- | tests/basic.py | 35 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/__init__.py diff --git a/tests/basic.py b/tests/basic.py new file mode 100644 index 0000000..34a2a01 --- /dev/null +++ b/tests/basic.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +import unittest +from unidecode import unidecode + +class TestUnidecode(unittest.TestCase): + def test_ascii(self): + for n in xrange(0,128): + t = chr(n) + + self.failUnlessEqual(unidecode(t), t) + + def test_specific(self): + + TESTS = [ + (u"Hello, World!", + "Hello, World!"), + + (u"'\"\r\n", + "'\"\r\n"), + + (u"ČŽŠčžš", + "CZSczs"), + + (u"ア", + "a"), + + (u"α", + "a"), + + (u"а", + "a"), + ] + + for input, output in TESTS: + self.failUnlessEqual(unidecode(input), output) |
