From b2cedd05e3ce012098c23fbb263dc382ac45a302 Mon Sep 17 00:00:00 2001 From: Tomaz Solc Date: Fri, 5 Sep 2008 16:51:19 +0200 Subject: Initial import. --- tests/__init__.py | 0 tests/basic.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tests/__init__.py create mode 100644 tests/basic.py (limited to 'tests') diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 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) -- cgit v1.2.1