aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2010-02-22 15:33:12 -0300
committerLauro Neto <lauro.neto@openbossa.org>2010-02-22 15:33:12 -0300
commit82e214967cc048cee380c5e97d3c3ad78d3a923a (patch)
tree19032b792c393009da1bf5046ddac768a40c612f /tests
parentfceead0efef4b6b833546ecd331f21dc878719c8 (diff)
Adding tests for QChar(Str)
Diffstat (limited to 'tests')
-rw-r--r--tests/qtcore/qchar_test.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/qtcore/qchar_test.py b/tests/qtcore/qchar_test.py
index 9cf5cbebc..a40724b0e 100644
--- a/tests/qtcore/qchar_test.py
+++ b/tests/qtcore/qchar_test.py
@@ -39,6 +39,21 @@ class QCharCtorBigNumber(unittest.TestCase):
self.assertEqual(qchar.unicode(), codepoint)
+class QCharCtorString(unittest.TestCase):
+ '''QChar constructor receiving strings'''
+
+ def testBasic(self):
+ '''QChar(char)'''
+ reference = 'a'
+ qchar = QChar(reference)
+ self.assertEqual(ord(reference), ord(qchar.toAscii()))
+
+ def testError(self):
+ '''QChar(char)'''
+ reference = 'aaaaaa'
+ self.assertRaises(TypeError, QChar, reference)
+
+
if __name__ == '__main__':
unittest.main()