Adding tests for QChar(Str)
This commit is contained in:
parent
fceead0efe
commit
82e214967c
1 changed files with 15 additions and 0 deletions
|
|
@ -39,6 +39,21 @@ class QCharCtorBigNumber(unittest.TestCase):
|
||||||
self.assertEqual(qchar.unicode(), codepoint)
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue