summaryrefslogtreecommitdiffstats
path: root/tests/QtCore/qstring_test.py
blob: 1b98de7673cca8d9ec3b66c459a3d74c9aeed838 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''Test cases for QString'''

import unittest
import ctypes
import sys

from PySide.QtCore import *

class QStringConstructor(unittest.TestCase):
    '''Test case for QString constructors'''

    def testQStringDefault(self):
        obj = QObject()
        obj.setObjectName('foo')
        self.assertEqual(obj.objectName(), u'foo')
        obj.setObjectName(u'áâãà')
        self.assertEqual(obj.objectName(), u'áâãà')
        obj.setObjectName(None)
        self.assertEqual(obj.objectName(), u'')

if __name__ == '__main__':
    unittest.main()