diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qtcore/qchar_test.py | 15 |
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() |